I have a slideshow that i replace an unordered list within the slide show, the images change but any effects are not inherited. this is the script that introduces a new DOM:
jQuery("#kwick1").click(function () {
jQuery('#photography').load('/design.html #photography');
});
jQuery("#kwick2").click(function () {
jQuery('#photography').load('/design.html #design');
});
how do i get the jQuery slideshow to inherit this new list of images??
i both these functions and the slide show function in the same file.
I have a
jQuery(document).ready(function() {
that loads the slideshow script.
Instead of attaching events to each of elements, you should learn how to use event delegation. That way you can attach single event listener on some container ( or even
document) and catch the events as they bubble up.Additionally it will make your code look much cleaner and easier to understand.
P.S. , if you put your code at the bottom of the HTML ( before
</body>) then, when it triggers , it will already be an “onDomReady” event.