jCarousel next and prev button, disable?

user431619 picture user431619 · Aug 30, 2011 · Viewed 15.6k times · Source

Im using http://sorgalla.com/projects/jcarousel/ as a slider.... It shows one image at a time, and a total of four images... When displaying the first image, i dont want the prev arrow to be visible, and the same if im at number 4 image, i dont want the next arrow to be visible...

How do i do this?

I initialize the script like this:

jQuery(document).ready(function() {
                                jQuery('#mycarousel').jcarousel();
                            });

Answer

Dennis picture Dennis · Aug 30, 2011

You can use CSS to hide the arrows. Adding the disabled classes is handled by the plugin itself.

.jcarousel-prev-disabled, .jcarousel-next-disabled
{
    visibility:hidden;
}

Demo: http://jsfiddle.net/ubanC/88/