开发者

Jquery mouseover firing click

Ive got a select menu and i want on mou开发者_运维问答seover to fire a click event,

I've got this

$('.selectMenu').live('mouseover', function() { $(this).click(); });

but it doesnt seem to be grabbing the right values. Any ideas how to fix this?


Maybe try:

$('.selectMenu').live('mouseover', function() { $(this).trigger('click'); });


I have some experience with this, as I was at one point tasked with making the fgMenu (which is made by Filament Group, the same group as the people who make the selectmenu plugin you are using).

The problem is that this plug-in creates elements which are then substituted for your original <select>, so monitoring for events on that original element will not help you. In my case, I had to modify the plug-in source to change the triggering event from click to hover.

Looking at the current source of the plug-in (which you can find here) and using some knowledge of how the rest of jQueryUI works, you may be able to invoke the open of the menu by doing something like this:

$('.selectMenu').live('mouseover', function() { $(this).selectmenu('open'); });

As a disclaimer, I haven't verified that this actually works, but it's the best guess I can make.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜