Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery - slideshow buttons function code
    primarykey
    data
    text
    <p>I have this very simple slideshow here: <a href="http://jsfiddle.net/Jtec5/33/" rel="noreferrer">fiddle</a><br> Jquery codes:</p> <pre><code>$("#slideshow &gt; div:gt(0)").hide(); var maxindex = $('#slideshow &gt; div').length; var index = 0 var interval = 3 * 1000; // 3 seconds var timerJob = setInterval(traverseSlideShow, interval); function traverseSlideShow() { console.log("current index: " + index); $('#slideshow &gt; div') .stop() .fadeOut(1000); $('#slideshow &gt; div').eq(index) .stop() .fadeIn(1000); $('ul li').removeClass('active'); $('ul li:eq(' + index + ')').addClass('active'); index = (index &lt; maxindex - 1) ? index + 1 : 0; } for (var i = 0; i &lt; maxindex; i++) { $('ul').append('&lt;li class="' + (i == 0 ? 'active' : '') + '"&gt;&lt;/li&gt;'); } $(document).on('click', 'ul li', function () { index = $(this).index(); traverseSlideShow(); clearInterval(timerJob); timerJob = setInterval(traverseSlideShow, interval); }); </code></pre> <p>As you can see there's three buttons, on clicking any button the slideshow automatically goes to the photo related with the button you click, and you can see the style of this button changes(on click and <strong>after passing 3 seconds</strong>).<br> I have one problem with this code that I'm trying to fix.<br> Well, I'm trying to prevent clicking any button for one second after any button's style is changed, simple, if you click any button you can not re click another button within 1 second, <strong>and</strong> as well, if the slideshow automatically loads a photo you can not load any other photo by clicking any other button within 1 second.</p>
    singulars
    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.
    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