Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Try something like this: <a href="http://jsfiddle.net/38pzs/" rel="nofollow">http://jsfiddle.net/38pzs/</a></p> <pre><code>&lt;div class="nextprev"&gt; &lt;div class="next"&gt;next&lt;/div&gt; &lt;div class="prev"&gt;Prev&lt;/div&gt; &lt;/div&gt; &lt;ul class="im"&gt; &lt;li class="active"&gt;&lt;img src="&lt;?php echo $this-&gt;basePath().'/images/feat/shop/1/1_large.jpg';?&gt;" /&gt;&lt;a class="next1" href="#"&gt;next&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="&lt;?php echo $this-&gt;basePath().'/images/feat/shop/2/2_large.jpg';?&gt;" /&gt;&lt;a class="next1" href="#"&gt;next&lt;/a&gt;&lt;a class="previous" href="#"&gt;prev&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="&lt;?php echo $this-&gt;basePath().'/images/feat/shop/3/3_large.jpg';?&gt;" /&gt;&lt;a class="next1" href="#"&gt;next&lt;/a&gt;&lt;a class="previous" href="#"&gt;prev&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="&lt;?php echo $this-&gt;basePath().'/images/feat/shop/4/4_large.jpg';?&gt;" /&gt;&lt;a class="next1" href="#"&gt;next&lt;/a&gt;&lt;a class="previous" href="#"&gt;prev&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="&lt;?php echo $this-&gt;basePath().'/images/feat/shop/5/5_large.jpg';?&gt;" /&gt;&lt;a class="previous" href="#"&gt;prev&lt;/a&gt;&lt;a class="startover" href="#"&gt;startover&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>css:</p> <pre><code>.im li { display: none; } .im li.active { display: inherit; } </code></pre> <p>html:</p> <pre><code>$(".prev").on('click', function() { $('li.active:not(:first-child)').removeClass('active').prev().addClass('active'); }); $(".next").on('click', function() { $('li.active:not(:last-child)').removeClass('active').next().addClass('active'); }); </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