Note that there are some explanatory texts on larger screens.

plurals
  1. POslider on continuous loop
    primarykey
    data
    text
    <p>I have created a review section which is trigged on click, what I want to achieve is that when the last review appears the first review appears after- a continuous cycle.</p> <p><a href="http://jsfiddle.net/melissaboyle19/kvVC7/" rel="nofollow">JS fiddle</a></p> <pre><code>/* Set global variables */ var position = $(".reviews").position(); /* Find position of review container */ var items = $(".reviews ul li").length; /* Count how many reviews there are */ var limit = (items - 2) * -435; /* Set the movement limit as a multiple of the number of items */ $(".number").text(items); /* Next button clicked */ $(".btn_next").click(function () { position = $(".reviews").position(); /* Debugging Info */ /* $(".left").text(Position: " + position.left + " &amp; " + "Items: " + items + " &amp; " + "Limit: " + limit); */ /* If the review container’s left value is still larger than the movement limit, move the container one view to the left */ if (position.left &gt; limit) { $(".reviews").animate({ "left": "-=460px" }, 500, "swing"); } else { /* $(".left").prepend("No dice! "); */ } }); /* Prev button clicked */ $(".btn_prev").click(function () { position = $(".reviews").position(); /* Debugging Info */ /* $(".left").text("Position: " + position.left + " &amp; " + "Items: " + items + " &amp; " + "Limit: " + limit); */ /* If the review container’s left value is still smaller than 0, move the container one view to the right */ if (position.left &lt; 0) { $(".reviews").animate({ "left": "+=460px" }, 500, "swing"); } else { /* $(".left").prepend("No dice! "); */ } }); </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.
    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