开发者

How do you access Dijit elements in jQuery?

For example, say I need to trigger an alert on dijitButton .hover() but how do I actually access开发者_高级运维 that button? Everything I do comes up blank, including giving the button an ID or trying to do .dijitButton, .dijitButtonNode, etc.

How do you access Dijit elements in jQuery?


dijit.byId("mybuttonId")._cssMouseEvent({type:"mouseover"});


Simple: you don't. Dojo objects are not jQuery objects an they don't share the same methods. You can't call jQuery.hover() on a Dojo object unless you use its ID and create a jQuery object from it. Otherwise, you need to use a Dojo equivalent.

[EDIT]

I've just noticed you already tried passing jQuery the button's ID. My guess is it doesn't work because at the time jQuery code executes, the button hasn't been yet created by Dojo.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜