簡體   English   中英

如何在新窗口中打開Arbor.js節點鏈接?

[英]How to open Arbor.js node link in a new window?

我是Arbor.js和js的新手。 我在頁面上設置了節點和邊緣-底層節點是可單擊的,並且在同一窗口中打開鏈接。 我想要在新窗口中打開鏈接。 有人可以提供任何建議嗎?

我相信相關代碼如下:

 moved:function(e){
        var pos = $(canvas).offset();
        _mouseP = arbor.Point(e.pageX-pos.left, e.pageY-pos.top)
        nearest = sys.nearest(_mouseP);

        if (!nearest.node) return false

        if (nearest.node.data.shape!='dot'){
          selected = (nearest.distance < 80) ? nearest : null
          if (selected){
             dom.addClass('linkable')
             window.status = selected.node.data.link.replace(/^\//,"http://"+window.location.host+"/").replace(/^#/,'')
          }
          else{
             dom.removeClass('linkable')
             window.status = ''
          }
        }else if ($.inArray(nearest.node.name, ['Library','Materials','Documentation','Literature']) >=0 ){
          if (nearest.node.name!=_section){
            _section = nearest.node.name
            that.switchSection(_section)
          }
          dom.removeClass('linkable')
          window.status = ''
        }

        return false

我關注的是window.status,但我對此並不了解。

任何幫助將不勝感激,謝謝。

我正在使用:

window.open(selected.node.data.link);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM