Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think what you are looking for is carousel.first, which will give you the index of the first visible element (there is also carousel.last to show the last visible element).</p> <p>Here is an example of it's use, based on the simple carousel example with the addition of the carousel.first variable and itemLoadCallback event:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $('#mycarousel').jcarousel({ itemLoadCallback: trigger }); }); function trigger(carousel, state) { $("#currentImg").html(carousel.first); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="wrap"&gt; &lt;h1&gt;jCarousel&lt;/h1&gt; &lt;h2&gt;Riding carousels with jQuery&lt;/h2&gt; &lt;h3&gt;Simple carousel&lt;/h3&gt; &lt;p&gt; This is the most simple usage of the carousel with no configuration options. &lt;/p&gt; &lt;ul id="mycarousel" class="jcarousel-skin-tango"&gt; &lt;li&gt;&lt;img src="http://static.flickr.com/66/199481236_dc98b5abb3_s.jpg" width="75" height="75" alt="" /&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="http://static.flickr.com/75/199481072_b4a0d09597_s.jpg" width="75" height="75" alt="" /&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="http://static.flickr.com/57/199481087_33ae73a8de_s.jpg" width="75" height="75" alt="" /&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="http://static.flickr.com/77/199481108_4359e6b971_s.jpg" width="75" height="75" alt="" /&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="http://static.flickr.com/58/199481143_3c148d9dd3_s.jpg" width="75" height="75" alt="" /&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="http://static.flickr.com/72/199481203_ad4cdcf109_s.jpg" width="75" height="75" alt="" /&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="http://static.flickr.com/58/199481218_264ce20da0_s.jpg" width="75" height="75" alt="" /&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="http://static.flickr.com/69/199481255_fdfe885f87_s.jpg" width="75" height="75" alt="" /&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="http://static.flickr.com/60/199480111_87d4cb3e38_s.jpg" width="75" height="75" alt="" /&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="http://static.flickr.com/70/229228324_08223b70fa_s.jpg" width="75" height="75" alt="" /&gt;&lt;/li&gt; &lt;/ul&gt; Current Photo &lt;span id="currentImg"&gt;1&lt;/span&gt; &lt;/div&gt; &lt;/body&gt; </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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. 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