javascript - How to make live custom events in jQuery -


In jQuery there really is an easy event binder, which is called live () which will add events to the DOM elements on the fly. (Even for elements which will be later added to the Dome). The problem is that it is only working on specific events ().

I really need a live event for focus, blurring and change, which is still not yet supported. In addition, if I can do live custom events, then this will be a big game changer for my app. Most codes that I have now are dedicated to reboot old events (changes, focus, and item dragging or custom event to resize) for the new DOM elements added through AJX.

Any thoughts? I think the event is a way to go to the delegation, but I just make the code more complex. Probably a plugin that handled the event delegation ... Not sure how to help me find the solution.

This functionality is now available in jQuery 1.4. Live () now supports all Javascript events (including custom events), and focusing and focusout events and Blurring have been introduced in the form. From:

In the form of jQuery 1.4, the .live () method supports custom events as well as all JavaScript events two exceptions: Since the focus and blurred are not actually bursting the events , So we need to use Focusin and Focus instead.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -