修好了。
我没有使用href属性,而是直接从该节点的onclick处理程序中调用了fancybox,得到以下结果:
var circle = this.paper.circle(150, 120, 100);
circle[0].style.cursor = "pointer";
circle.attr({
fill: "green",
stroke: "#333",
"stroke-width": 10,
});
circle.node.onclick = function () {
$.fancybox({
'href' : 'ajax.html',
'width' : '75%',
'height' : '75%',
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'type' : 'iframe'
});
if (circle.attr("fill") == "red") {
circle.attr("fill", "green");
} else {
circle.attr("fill", "red");
}
};
真管用!