Since in my situation the images are coming from the database and I want random images to appear every time the page is opened I would prefer to declare the images not in the JS function but have them in the HTML. What should I change to make that happen. Thank you all in advance
That would be a better idea anyway. :-) Now I don’t know what library you are using for this, but generally you might specify them as a comma separated list in a data-* attributes…
But since these images are most probably getting appended to the wrapper element as img elements anyway, you might just as well put them in the markup from the start… if that extension allows that of course.
No I meant which jQuery extension you’re using… is it this one? The documentation is a bit meager there, but looking at the code it doesn’t look like you can use existing img elements…