Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've got you a solution. I'm using images in my <a href="http://jsfiddle.net/jamwaffles/6xXf6/" rel="nofollow">JSFiddle</a>, but they're only to demonstrate the effect. Fading between black backgrounds is difficult; I suggest you give the <code>ul</code> a black background and fade the text/content above it in and out; it will give a nicer effect.</p> <p>This is the code from the Fiddle. If you need an explanation, please ask.</p> <pre><code>function fadeDivs() { var currentPanel = $("ul li:visible"); var currentPanelIndex = currentPanel.index(); currentPanel.fadeOut(1000); // If the next panel to fade in is beyond the last, start from the beginning again. if(currentPanelIndex == ($("ul li").length - 1)) { $("ul li:first-child").fadeIn(1000); } else // If it's not the last li, keep going through the list { currentPanel.next().fadeIn(1000); } // Keep the ball rolling setTimeout(fadeDivs, 5000); } $(document).ready(function() { // Just to make it look nice - this can be deleted (it's just filler content) $("ul li:eq(0)").html("&lt;img src='http://barbados.org/landscap/bcparadise1.jpg'&gt;"); $("ul li:eq(1)").html("&lt;img src='http://www.get-free-wallpapers.com/wallpaper/previews/3652-1202425455/nature/oceans/3652-victoria-beach-laguna-beach-california.jpg'&gt;"); $("ul li:eq(2)").html("&lt;img src='http://www.traveltovietnam.cc/Upload/Tour/2352008111155_SplendorOfMuiNeBeachMuiNe2.jpg'&gt;"); $("ul li:eq(3)").html("&lt;img src='http://www.croatia-danexumag.com/cms_upload/upload/Apartments_VERUDELA_BEACH_00.jpg'&gt;"); // Start the ball rolling setTimeout(fadeDivs, 3000); }); </code></pre> <p>The images are licensed under blah blah who cares, bring on the lawsuit for me stealing your beach ;-)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload