You cannot X-fade 2 background images at a time to force an element to support only one BG image. At least not overlapping background images. (correct me if I am wrong)
Instead, you can read your URLs, create real images and add them to the element you need:
var images = [ '/slideshow1.jpg', '/slideshow2.jpg', '/slideshow3.jpg' ]; var imagesN = images.length; var $slideme = $('#slideme'); for(i=0;i<imagesN;i++){ $('<img>',{ src : images[i] }).appendTo( $slideme ); }
// NOW YOUR IMAGES ARE CLOSING, DON'T FORGET THE CSS OF THEM: position:absolute; to get one or the other.
How can you use my jQuery plugin to gradually transform your images. The plugin allows you to pause on a hover , as well as click on the image to advance !
/* FadeMe 'FPS' // jQuery plugin // Author: Roko C. Buljan (2012) // www.roxon.in */ (function($){ $.fn.fademe = function(F,P,S){ F=F||700; // Fade time (default) P=P||3000; // Pause time (default) S=S-1||0; // Start from 1st image (default) var e=this.children(),T; function a(){ e.eq(S=++S%e.length).fadeTo(F,1).siblings(e).stop(1).fadeTo(F,0); } e.on('mouseenter mouseleave click',function(e){ var m=e.type==='mouseenter'?clearTimeout(T):(e.type==='click'?a():aa()); }).eq(S).show().siblings(e).hide(); function aa(){T=setTimeout(function(){a();aa();},F+P);}aa(); }; })(jQuery); $slideme.fademe(); // initiate plugin on your element
Remembering "FPS", for example: "Frame-Per-Second" :), you can easily change / override the default values ββfor the plugin:
$slideme.fademe(1300, 9000, 1);
leading to 1300ms fade; 9000 pause Start with the β1stβ image (default). To skip some defaults to achieve a property you can do:
$slideme.fademe(0, 0, 2);
which will be translated into: default Fade (700); default Pause (3000); but start with the second image.
EDIT , if you want to use background images, follow these steps: