English 中文(简体)
Raphael Javascript Library公司的活动处理
原标题:Event handling in Raphael Javascript library

I am working with Raphael JS library. It s been so great and suits the requirements too. I am trying to figure out, how to write a generic event handler for all the nodes in library. I would need the clicked object instance to customize it s attributed on click event.

我已宣布为科安会的拉法尔峡谷,因此,如果有人点击我会利用“Qu子”在本手里接手。 我也附上了信道上所有节点的 no。

这里是基因的原型。

$j( #holder ).bind( click , function(event) {

  // event handler.

}

然而,我无法收到被点击的点子的标本。

<代码>event.srcElement属性也失败。

任何帮助都将受到高度赞赏。

Thanks, Karthik.

问题回答

我认为,问题可能是,当Raphael像你想要得到的东西一样是控制这一产出的原始Raphael数据标的时(而不是实际产出本身),你会利用j Query的点击功能将活动交给DOM/SVG/VERL。

So you probably will get what you want by calling Raphael s own .click() function binding on to the variable you defined when you first called the Raphael function (e.g. the someVar in var someVar = Raphael(xxx...);).

然后,this应当给Raphael的物体(不过,请你在.click(功能(){}内已经界定的变量);可取得更可靠的结果,特别是如果后来你想要

That s how it works for elements, the same or similar logic would probably follow for the paper/canvas itself.





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签