Note that there are some explanatory texts on larger screens.

plurals
  1. POJcarousel highlight the first visible photo
    primarykey
    data
    text
    <p>Here is one little tougher challenge.</p> <p>Click my jsfiddle <a href="http://jsfiddle.net/qUKrm/" rel="nofollow">Here</a>: </p> <p>I am using this <a href="http://sorgalla.com/projects/jcarouse" rel="nofollow">jQuery plugin</a> for an album. I want to highlight the item whenever user click the pic. It is done !</p> <p>below is the function to trigger the album:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://sorgalla.com/projects/jcarousel/lib/jquery.jcarousel.min.js"&gt;&lt;/script&gt; &lt;!--&lt;link rel="stylesheet" type="text/css" href="http://sorgalla.com/projects/jcarousel/skins/tango/skin.css" /&gt;--&gt; &lt;style&gt; .jcarousel-skin-tango .jcarousel-container { -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; background: #F0F6F9; border: 1px solid #346F97; } .jcarousel-skin-tango .jcarousel-container-horizontal { width: 300px; padding: 20px 40px; } .jcarousel-skin-tango .jcarousel-container-vertical { width: 75px; height: 245px; padding: 40px 20px; } .jcarousel-skin-tango .jcarousel-clip-horizontal { width: 300px; height: 75px; overflow:hidden; } .jcarousel-skin-tango .jcarousel-item { width: 75px; height: 75px; } .jcarousel-skin-tango .jcarousel-item-horizontal { margin-left: 0; margin-right: 10px; }/* .jcarousel-skin-tango .jcarousel-direction-rtl .jcarousel-item-horizontal { margin-left: 10px; margin-right: 0; } .jcarousel-skin-tango .jcarousel-item-placeholder { background: #fff; color: #000; } */ /** * Horizontal Buttons */ .jcarousel-skin-tango .jcarousel-next-horizontal { position: absolute; top: 43px; right: 5px; width: 32px; height: 32px; cursor: pointer; background: transparent url(http://sorgalla.com/projects/jcarousel/skins/tango/next-horizontal.png) no-repeat 0 0; } .jcarousel-skin-tango .jcarousel-direction-rtl .jcarousel-next-horizontal { left: 5px; right: auto; background-image: url(http://sorgalla.com/projects/jcarousel/skins/tango/prev-horizontal.png); } .jcarousel-skin-tango .jcarousel-next-horizontal:hover, .jcarousel-skin-tango .jcarousel-next-horizontal:focus { background-position: -32px 0; } .jcarousel-skin-tango .jcarousel-next-horizontal:active { background-position: -64px 0; } .jcarousel-skin-tango .jcarousel-next-disabled-horizontal, .jcarousel-skin-tango .jcarousel-next-disabled-horizontal:hover, .jcarousel-skin-tango .jcarousel-next-disabled-horizontal:focus, .jcarousel-skin-tango .jcarousel-next-disabled-horizontal:active { cursor: default; background-position: -96px 0; } .jcarousel-skin-tango .jcarousel-prev-horizontal { position: absolute; top: 43px; left: 5px; width: 32px; height: 32px; cursor: pointer; background: transparent url(http://sorgalla.com/projects/jcarousel/skins/tango/prev-horizontal.png) no-repeat 0 0; } .jcarousel-skin-tango .jcarousel-direction-rtl .jcarousel-prev-horizontal { left: auto; right: 5px; background-image: url(next-horizontal.png); } .jcarousel-skin-tango .jcarousel-prev-horizontal:hover, .jcarousel-skin-tango .jcarousel-prev-horizontal:focus { background-position: -32px 0; } .jcarousel-skin-tango .jcarousel-prev-horizontal:active { background-position: -64px 0; } .jcarousel-skin-tango .jcarousel-prev-disabled-horizontal, .jcarousel-skin-tango .jcarousel-prev-disabled-horizontal:hover, .jcarousel-skin-tango .jcarousel-prev-disabled-horizontal:focus, .jcarousel-skin-tango .jcarousel-prev-disabled-horizontal:active { cursor: default; background-position: -96px 0; } &lt;/style&gt; &lt;script&gt; $(document).ready(function(){ jQuery('#mycarousel').jcarousel({ scroll:2, animation:'slow', wrap:'last', initCallback:function(){ $("#mycarousel li:eq(0)").css('border','2px solid gray'); } }); $("#mycarousel li").click(function(){ $("#mycarousel li").css('border','none'); $(this).css('border','2px solid gray'); }); }); &lt;/script&gt; &lt;title&gt;Untitled Document&lt;/title&gt; &lt;/head&gt; &lt;body&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; &lt;/ul&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Now, What I want is that Whenever user clicks the next or previous arrow, First visigble item should be highlighted with border.</p> <p>Can use proper configuration to function to get this done ? Below is link for the plugin docs <a href="http://sorgalla.com/projects/jcarousel/#Configuration" rel="nofollow">http://sorgalla.com/projects/jcarousel/#Configuration</a></p>
    singulars
    1. This table or related slice is empty.
    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