有人可以为Raphael JS事件提供一些代码示例
Someone can provide some code example for Raphael JS events?
我不知道如何使用Raphael JS事件。
我需要一些例子。我看到文档和一个函数必须传递,但没有工作。
有人可以提供一些例子,如何获得鼠标的位置点击在画布上?
EDIT:我在Element
的文档事件中看到。这对Paper
有用吗?如何为Paper
创建mousedown()
事件
clickEvent = function(){
alert("Hello World!");
}
paper = Raphael(...);
paper.raphael.click(clickEvent);
p.mouseover(function () {
p.stop().animate({transform: "s1.1 1.1 " + cx + " " + cy}, ms, "elastic");
txt.stop().animate({opacity: 1}, ms, "elastic");
}).mouseout(function () {
p.stop().animate({transform: ""}, ms, "elastic");
txt.stop().animate({opacity: 0}, ms);
});
查看Raphael示例中的源代码。
下面是另一个带有click事件的例子:
movers[2].click(function () {
this.cx = this.cx || 300;
this.animate({cx: this.cx, "stroke-width": this.cx / 100, fill: this.cx - 100 ? "hsb(.2, .75, .75)" : "#000", "fill-opacity": +!!(this.cx - 100)}, 1000, "<");
this.cx = this.cx == 300 ? 100 : 300;
});
取自于前面的例子
相关文章:
- 如何将javascript事件从web浏览器wpf控件发送到wpf的c#代码
- php代码在textbox更改事件上显示null
- 如何在Win8Metro应用程序的Javascript代码中捕获自己的C#事件
- 访问代码生成的输入元素上的keyup事件
- 如何在 JavaScript 代码中调试点击事件处理
- 如何使用我的Jquery代码创建委托事件侦听器
- 如何使用onclick事件触发此代码.我尝试过,但失败了
- 在单击事件中,第一次单击时激发代码一次,其余代码在所有单击时运行
- 为什么动态加载的事件在我的代码中不能正常工作
- 我需要java代码来打开html代码onclick事件
- 使用Javascript代码在文本框上激发退格事件
- onbeforeunload事件在我的代码中没有触发,但其他示例可以工作
- 如何在onclick事件执行代码时在ImageButton上设置加载gif
- 在按钮'上运行PHP代码;s onclick事件,或者使用Ajax
- 我想在每个按钮点击事件上加载多个图表.我使用了下面的谷歌代码
- HTML5 嵌入代码 - 事件属性未触发(已触发、暂停等)
- 在ionicPopup完成加载后运行代码/事件
- 如何在添加键代码事件处理程序后删除它
- 调试JS/CoffeeScript代码:事件,回调等
- 当值更改时,用于表单文本字段的代码事件侦听器