我是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);