使用raphael.js/openlayers.js库成功附加单击和双击事件的方法 [英] Way to attach click and double click events succesfully using raphael.js/openlayers.js libraries
本文介绍了使用raphael.js/openlayers.js库成功附加单击和双击事件的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的一个朋友在尝试同时附加单击和双击事件以在某个层上各自拥有不同的功能时遇到了一些问题.他正在尝试使用raphael.js和openlayers.js库执行此操作,但没有成功.我们对此发布进行了一些研究和解决方案:在由doubleclick阻止的点击上不是不能完全正常工作.
A friend of mine is having some issues while trying to attach click and double click events simultaneously to do different things each own for a certain layer. He is trying to do it with raphael.js and openlayers.js libraries with no success. We did some research and the solutions on this post: on click stopped by doubleclick aren't working completely.
有没有一种有效的方法来做到这一点?
Is there an efficient way to do this?
谢谢.
推荐答案
您是否在寻找 此 :
Are you looking for this:
var paper = Raphael('area', 300, 300);
var r = paper.rect(100, 100, 70, 35, 5).attr({fill: 'red'});
r.click(function() {
this.animate({fill: 'blue'}, 200);
});
r.dblclick(function() {
this.animate({fill: 'green'}, 200);
});
这篇关于使用raphael.js/openlayers.js库成功附加单击和双击事件的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文