views:

29

answers:

2

I'm using a jQuery UI plugin that captures mouse/keyboard clicks (ui.selectable.js) and doesn't seem to propagate it further.

Is there some trick I can use to capture keydown or mouse* events in my code even for elements where the plugin is already listening for these events and not propagating them?

A: 

I think you ought to see this podcast, its not very long but it will make you understand event delegation in jquery :

http://james.padolsey.com/javascript/screencast-1-event-delegation-in-jquery/

c0mrade
This is an easier read and explains how it works too independent of jQuery - http://www.quirksmode.org/js/events_order.html. Neither really helps me though - I'm looking for a way to circumvent the `.stopPropagation()` if possible at all.
psychotik
A: 

Hi,

maybe the live() method is what you are searching for to capture the specified events e.g. "mouseover" or "keydown" if they are already captured by your plugin.

Note that you'll have to use jQuery 1.4 to bind more than one live event of the same type to an object - if I remember the release notes correctly ;)

btw: you are able to stop the plugin for specific objects by using die() or unbind()

Joe
good idea, but this doesn't work. I should've mentioned I tried using `live()` already. Also, I don't want to unbind the plugin, just get it to propagate the event. Of course, I can change the source as a last resort...
psychotik
hmmm are you sure you're using the jQuery 1.4 version? In 1.3 live event capturing was unique and it won't work though, but 1.4 should do it. Perhaps you could submit some example code to text this?
Joe
Using 1.3.2... There are reasons why I can't move to 1.4 just yet. This is good to know though... I'll try it just to verify
psychotik
Binding multiple live() events is one of the cool new features of 1.4 :) Let me know if it worked!
Joe