Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I expanded what was already shown and added a indicator feature that can be used and placed anywhere. <a href="http://jsfiddle.net/BadBoyBill/8yHmy/" rel="nofollow">http://jsfiddle.net/BadBoyBill/8yHmy/</a></p> <pre><code>$(document).ready(function(){ $("div[id^=marquee]:gt(0)").hide(); function startTimer(){ i = setInterval(rotate, 2000); return i; } var intID = startTimer(); function stopTimer(){ clearInterval(intID); } function rotate(){ reference = $("div[id^=marquee]:visible").hide().next("div[id^=marquee]"); reference.length ? $(reference).fadeIn() : $("div[id^=marquee]:first").fadeIn() ; dot = $(".indicator-on[id^=indicator]").removeClass("indicator-on").next("a[id^=indicator]").addClass("indicator-on"); dot.length ? $(dot).addClass("indicator-on") : $("a[id^=indicator]:first").addClass("indicator-on"); } $("div[id^=marquee]").each(function(){ $("#indicators").append("&lt;a href='#' id='indicator' class='indicator'&gt;&lt;/a&gt;"); $(".indicator:first").addClass("indicator-on"); }); $("a[id^=indicator]").click(function(e){ var index = $("a[id^=indicator]").index(this); //alert(index); $("div[id=marquee]").hide(); $("div[id=marquee]").eq(index).show(); $("a[id=indicator]").removeClass("indicator-on"); $("a[id=indicator]").eq(index).addClass("indicator-on"); stopTimer(); intID = startTimer(); e.preventDefault(); }); $("a[id=indicator], div[id=marquee]").mouseenter(function(){ stopTimer(); //alert("mouseenter"); }).mouseleave(function(){ stopTimer(); intID = startTimer(); //alert("mouseexit"); }); });​ </code></pre>
 

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