- This topic is empty.
April 6, 2011 at 3:46 pm #32257
on this site there’s a screencast about dynamic content:
it works fine but there are alot of people having the same problem as me and have no clue how to solve it..
I already wasted so many hours of googling for the answer but still no luck. I read about replacing .bind() with .live() but didn’t get it to work..anyone?!April 6, 2011 at 4:49 pm #51993TT_MarkMember
Or, when you load in the dynamic content, existing events like mouseover and click will not fire on the fire content?
Got a live link to the site or code?April 6, 2011 at 5:13 pm #51999
In the new content is f.e. a lightbox plugin but it doesn’t work..same for all plugins
you can see it here: https://css-tricks.com/examples/DynamicPage/
code is here: https://css-tricks.com/dynamic-page-replacing-content/
Thanks!April 7, 2011 at 3:40 pm #51869TT_MarkMember
I dont think the latter will work, not sure if the former works either…
Can you not have the plugin always in the source code, whatever content is showing?April 7, 2011 at 7:23 pm #51875Chris CoyierKeymaster
It really is all about using .live() or .delegate(), or rebinding events every time you load in new content.
I haven’t look at that tutorial in a while, but I’m sure it uses .load() to pull in HTML from the other pages. With .load() you can declare a callback function. Callback functions are functions that fire once the function calling it is totally done doing it’s thing, meaning in this case the HTML has been injected and it’s ready to go. In that callback function, you’d re-bind any events attached to elements that you need to work.April 7, 2011 at 8:23 pm #51879
Thanks for the reply’s! going to give it another try..April 10, 2011 at 4:43 pm #51659mohammadMember
hi.how can add loading… image gif animation for this(https://css-tricks.com/examples/DynamicPage/) when content loading?