Using the jQuery clone() method with a lightbox

So I’m using Flexslider, which is a jQuery slideshow with some great touch capabilities. However, it only displays one slide at a time, so I hacked at it until I got it to display 3. Of course, only later did I realize that someone already forked it on Github like 2 months ago and did this before me, oops. Anyhow, Flexslider uses the clone() method to pad out slides at the end of the slideshow, and, with the modified script, these cloned slides get displayed.

So I’m using Lightbox (the Lightbox2 module for Drupal 6, to be specific) and it’s not liking those cloned slides. Nope, not at all. Doesn’t work. Have no clue why, and couldn’t really find anyone else with that problem on the internets. What I did figure out, though, is when you call clone, if you call it with the parameter of true: clone(true). And that seems to work, as my cloned slides now open in lightboxes. So, yay!

Leave a Reply