Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You did not assign the function to the slides in other sections. Only the slides in first section have the onclick function defined. Make sure you loop through all of them at the beginning</p> <pre><code>for (var i=0; i &lt; noOfSections; i++) { var secName = sections[i]; // call prev/next functions $('#'+secName+' &gt; div').click(function() { var index = $('#'+secName+' &gt; div').index(this); if (index &gt; centSlide) nextcycle(centSlide, slideCount); if (index &lt; centSlide) prevcycle(centSlide, slideCount); return false; }); // cycle sections $('#'+secName+' .select').click(function () { if (!e) var e = window.event; e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); $('.liveslide').removeClass('liveslide'); $('.prev').removeClass('prev'); i = $('#'+secName+' .select').index(this); liveSec(i); }); </code></pre> <p>}</p> <p>What actually worked for me in fiddle was when you move the closing bracket of the liveSec function underneath the second click function, but I'm not sure how your sections work, so it could end up assigning the click function multiple times unless you unbind it first.</p> <pre><code>// Initiate live section function liveSec(x) { centSlide = 0; secName = $('#slider &gt; div:eq('+x+')').attr('id'); slideCount = $('#'+secName+'').children().length; $('#'+secName+'').children().first().addClass('liveslide').next().addClass('next'); // call prev/next functions $('#'+secName+' &gt; div').click(function() { var index = $('#'+secName+' &gt; div').index(this); if (index &gt; centSlide) nextcycle(centSlide, slideCount); if (index &lt; centSlide) prevcycle(centSlide, slideCount); return false; }); // cycle sections $('#'+secName+' .select').click(function () { if (!e) var e = window.event; e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); $('.liveslide').removeClass('liveslide'); $('.prev').removeClass('prev'); i = $('#'+secName+' .select').index(this); liveSec(i); }); } </code></pre>
    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.
 

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