Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It is possible using the <a href="http://www.w3schools.com/jsref/met_win_setinterval.asp" rel="nofollow">''setInterval''</a> JavaScript function. Look at <a href="http://jsfiddle.net/rvZFA/5/" rel="nofollow">this JSFiddle here</a> for an example how it could work.</p> <p><strong>HTML:</strong></p> <pre><code>&lt;div class="container"&gt; &lt;div class="marker"&gt;&lt;/div&gt; &lt;div class="marker"&gt;&lt;/div&gt; &lt;div class="marker"&gt;&lt;/div&gt; &lt;div class="marker"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>CSS</strong>:</p> <pre><code>.marker { background: #999; float: left; width: 20px; height: 20px; margin: 0 5px 0 0; } .marked { border: 2px solid red; } </code></pre> <p>​ <strong>JavaScript:</strong></p> <pre><code>jQuery(function() { // Set border around first element jQuery('.container .marker:first').addClass('marked'); // Start interval with 5 second steps var iv = setInterval(function() { // Executes every 5 seconds // Is there a next element? if (jQuery('.marker.marked').next('.marker').length == 1) { jQuery('.marker.marked') // actual marked element .removeClass('marked') // remove border .next('.marker') // go to next element .addClass('marked'); // add border } else { // No next element? Start again with first element jQuery('.marker.marked').removeClass('marked'); jQuery('.container .marker:first').addClass('marked'); } }, 5000); });​ </code></pre> <p>It is not clear from your question if you want to do one run from left to right or if it has to start again on the left after the last image in the sequence. My example stops after last div. You would have to replace the DIV elements with your image elements. They only have to have the class ''marker'' attribute.</p> <p><strong>EDIT</strong>: The updated fiddle/code above cycles through the elements and repeats again with the first element.</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.
    1. VO
      singulars
      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