arrays - jQuery Backstretch - Create slideshow with images' src attribute -
i'm using jquery backstretch's slideshow functionality. i'm going using across multiple pages, different sets of images. thought make more sense through images in wrapper element, src attributes, , insert them $.backstretch()
function.
i've never been @ arrays, i'd imagine that's need create work.
i've found example of how accomplish if you're using 1 image, want use 2 or more can take advantage of slideshow functionality.
here's example of how can accomplished 1 image:
html
<img src="/media/img/test.jpg" id="bgimg" />
js
var imgobj = $("#bgimg"); var imgsrc = imgobj.attr("src"); imgobj.remove(); //remove original image dom $.backstretch(imgsrc, {centeredx:true, centeredy:true});
thanks!
loop items each function push them array
var list = new array() ; $('object path').each(function(){ list.push($(this).attr("src")); $(this).remove(); }); $.backstretch(list, {centeredx:true, centeredy:true}) ;
Comments
Post a Comment