KineticJS text as links?

时光毁灭记忆、已成空白 提交于 2019-12-11 19:17:54

问题


Is there anyway to make the texts and/or shapes be hyperlinks? Being that when they are clicked, they bring up new browser and when you hover over them, they show location of the url?


回答1:


You can't make the browser to show the url of links in statusbar which are not an a tag. But you can indeed ad a click handler on kinetic objects and make them act a link.

text.on('click', function() {
    // do something
});

http://jsfiddle.net/4JYGL/



来源:https://stackoverflow.com/questions/16405588/kineticjs-text-as-links

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!