Note that there are some explanatory texts on larger screens.

plurals
  1. POneed help with jquery selectors
    primarykey
    data
    text
    <p>I've got code like that:</p> <pre><code>&lt;ul class="gallery_demo_unstyled"&gt; &lt;li class="active"&gt;&lt;img src='001.jpg' /&gt;&lt;/li&gt; &lt;li&gt;&lt;img src='002.jpg' /&gt;&lt;/li&gt; &lt;li&gt;&lt;img src='003.jpg' /&gt;&lt;/li&gt; &lt;li&gt;&lt;img src='004.jpg' /&gt;&lt;/li&gt; &lt;li&gt;&lt;img src='005.jpg' /&gt;&lt;/li&gt; &lt;li&gt;&lt;img src='006.jpg' /&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div class="Paginator"&gt; &lt;a href="../2/" class="Prev"&gt;&amp;lt;&amp;lt;&lt;/a&gt; &lt;a href="../1/"&gt;1&lt;/a&gt; &lt;a href="../2/"&gt;2&lt;/a&gt; &lt;span class="this-page"&gt;3&lt;/span&gt; &lt;a href="../4/"&gt;4&lt;/a&gt; &lt;a href="../5/"&gt;5&lt;/a&gt; &lt;a href="../4/" class="Next"&gt;&amp;gt;&amp;gt;&lt;/a&gt; &lt;/div&gt; &lt;div class="Albums"&gt;&lt;div class="AlbumsMenu"&gt; &lt;p&gt;&lt;b&gt;ALBUMS&lt;/b&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="../../blackandwhite/1/" &gt;blackandwhite&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="../../color/1/" class='this-page'&gt;&gt;&gt;color&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="../../film/1/" &gt;film&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="../../digital/1/" &gt;digital&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="../../portraits/1/" &gt;portraits&lt;/a&gt;&lt;/p&gt; &lt;/div&gt;&lt;/div&gt; </code></pre> <p>...and some JavaScript/jQuery allowing to cycle through the images (the very top li elements) going back to the first image after the last one:</p> <pre><code>$$.nextSelector = function(selector) { return $(selector).is(':last-child') ? $(selector).siblings(':first-child') : $(selector).next(); }; </code></pre> <p>Current page is always 'this-page' class (span or p in my case, but I could change that if necessary).</p> <p><b>The question</b>: what should I change in my code to make it go after the last image to the next page instead of cycling through the page over and over again, and after the last page to the next album? And to the first image on the first page of the first album after the last-last-last (or just stop there — don't really care)?</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.
 

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