I’m attempting to figure out a JavaScript/jQuery solution that gets the source of image elements and replaces the images with an element that has its background set to the source of said image.
I’ve written out the following in an attempt to get it working, but it only works on a single image instead of all in the list.
var slideImgSrc = jQuery('ul.portfolio-slider li.panel img.alignnone').attr('src');
jQuery('ul.portfolio-slider li.panel img.alignnone').replaceWith('');
What do I need to do to get it working in the entire list instead of just the first?
Here’s a jsFiddle:
http://jsfiddle.net/mrdw2/
Thank you guys. I’m still not comfortable with JavaScript but I’m getting there.