I’m currently designing a single page application and wanted to make use of jQuery UI.
Unfortunately jQuery UI does not attach its functionality to dynamically added elements.
So inserting a jQuery UI button (having all necessary classes) after loading the page erases all functionalities (e.g. change color on hover).
jQuery’s deprecated live()-method should be able to avoid that but obviously it isn’t used by jQuery UI.
I hope you have an idea! 🙂
Thanks a lot!
Leo
You can add the event in the code that adds the new element. See this fiddle for an example.
http://jsfiddle.net/uHEre/3/
Also, as noted in the fiddle comments,
.on()is the new.live(). See http://api.jquery.com/on/