Way to attach click and double click events succesfully using raphael.js/openlayers.js libraries

ぃ、小莉子 提交于 2019-12-12 01:15:57

问题


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?

Thanks in advance.


回答1:


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);
});


来源:https://stackoverflow.com/questions/17370963/way-to-attach-click-and-double-click-events-succesfully-using-raphael-js-openlay

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