IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Any jquery experts here? Need to use '.live'
I'm using the "read here right now" plugin, which dynamically adds content to the page. I'm also using Lightbox, which initializes when the "ready" method fires. So any new images injected by RHRN don't get the Lightbox treatment.

The author of RHRN suggests that plugin authors can use the '.live' method of jquery >1.4 to re-init when new content is added, but I can't find any good documentation on how to actually do that.
--

Drew
New I've recently done nearly that.
Only I used delegate. The two functions are very similer but delegate is slightly more versatile. Basically, you need to figure out a jQuery selector that matches the elements you will want to re-attach the lightbox plugin to. Then in the anonymous function, you can call the lightbox plugin on the appropriate event (such as click).

With live you have to be able to match your exactly target elements in the jQuery selector. With delegate, you can do the element matching in two parts: one in the jQuery selector (such as the container for where the new elements will always be added in), then within that in the delegate call.

Wade.

Q:Is it proper to eat cheeseburgers with your fingers?
A:No, the fingers should be eaten separately.
New Can probably use 'live' to do it
Delegate would be better, though. And that takes jquery 1.4, which I'm not on yet. Looks like I need to block out some time, but the bullet, and move to WP3. Then I'll come back and ask how to add delegate to the lightbox plugin. [sigh]
--

Drew
     Any jquery experts here? Need to use '.live' - (drook) - (2)
         I've recently done nearly that. - (static) - (1)
             Can probably use 'live' to do it - (drook)

None more embeddeder, I'd say.
62 ms