KineticJS文本作为链接? [英] KineticJS text as links?

查看:86
本文介绍了KineticJS文本作为链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否总有文字和/或形状成为超链接?就是说,当它们被单击时,它们会打开新的浏览器,而当您将鼠标悬停在它们上面时,它们会显示网址的位置?

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?

推荐答案

您不能使浏览器在状态栏中显示不是a标记的链接的URL.但实际上,您可以在动力学对象上添加点击处理程序,并使它们充当链接.

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/

这篇关于KineticJS文本作为链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆