2015-01-09 105 views
0

我是Arbor.js和js的新手。我有一个设置了节点和边的页面 - 底层节点是可点击的,并在同一个窗口中打开链接。我想要链接在新窗口中打开。任何人都可以提供建议吗?如何在新窗口中打开Arbor.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但我不知道有足够的了解这一点。

任何帮助将不胜感激,谢谢。

回答

0

我使用:

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

相关问题