一般来说,我对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,但对此我还不太了解。
任何帮助都将不胜感激,谢谢。
发布于 2015-04-01 14:18:50
我在用:
window.open(selected.node.data.link);
https://stackoverflow.com/questions/27867378
复制相似问题