Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting number of visible images in jCarousel

I integrated jCarousel into my asp.net page but it's always showing only 3 images at a time. If I need to show 10 images at a time, then what should I change in the code?

Here is my little snippet:

jQuery(document).ready(function () {
    jQuery('#mycarousel').jcarousel({
        size:5,
        itemLoadCallback: mycarousel_itemLoadCallback
    });
});

function mycarousel_getItemHTML(mother) {
    var item = "<div>";
    item += "<img src='" + mother.Image + "' width='75' height='75' />";
    item += "</div>";
    item += "<div>" + mother.Title + "</div>";
    return item;
};
like image 974
Thomas Avatar asked Dec 01 '22 02:12

Thomas


2 Answers

Try this

jQuery('#mycarousel').jcarousel({
    visible: 3
});
like image 68
Coomie Avatar answered Dec 09 '22 23:12

Coomie


Need to change both width of container & clip; & increase item numbers by visible: 10

JS

jQuery('#mycarousel').jcarousel({
    visible: 10
});

CSS

.jcarousel-skin-ie7 .jcarousel-container-horizontal
{
    width:750px;
}

.jcarousel-skin-ie7 .jcarousel-clip-horizontal {
    width:740px; 
}
like image 44
Avisek Chakraborty Avatar answered Dec 09 '22 22:12

Avisek Chakraborty