6

I'm working with this scroller

http://coolcarousels.frebsite.nl/c/2/

I have this setup below.

My issue is I have it set to visible: 4 and I have 4 images, so it doesn't scroll. If I set it to visible: 3 then it works as expected. But I want to show all 4 images in one screen when you open the browser full width on a 1920px wide resolution. So the issue seems to be. If I set visible to the amount of images I have then it stops working.

Is there a way to have all 4 images on screen at one time then still scroll through them?

$(function() {
    $('#carousel').carouFredSel({

        width: '100%',  
        align: 'left',

        items: {
            visible: 4,
            start: 0,


        },
        scroll: {
            items: 1,
            queue           : true,
            fx: "scroll",
            easing: "swing",
            duration: 1000,
            timeoutDuration: 3000
        },

        prev: '.prev',
        next: '.next',


        auto: {
            easing: "quadratic",
            button: '.play',

            pauseOnEvent: 'resume',
                pauseOnHover: true
        }

    }).find(".slide .plusNav").hover(
              function() { $(this).find("div").slideDown(); },
              function() { $(this).find("div").slideUp();   }
    );
});
Patricia
  • 7,752
  • 4
  • 37
  • 70
John Preston
  • 61
  • 1
  • 2

4 Answers4

7

try this

items: {
    minimum: 0,
},
zohei
  • 71
  • 5
0

I have resolved this issue by setting minimum to 0.

items: {
    minimum: 0,

Actually, setting the minimum attribute to zero forces the scroll bar to be displayed always irrespective of number of items currently displayed.

This was required for me because, automatic enabling of scroll bars was not working on certain screen resolutions- I had to add 2 more items to make the scroll bar visible which was not the expected behavior.

As a work around, I set minimum: 0 - it resolved the issue.

Alex M
  • 2,756
  • 7
  • 29
  • 35
VenuKota
  • 1
  • 1
-1

I was able to do this by editing the source :/

If you comment out this lines 554 & 556 in jquery.carouFredSel-6.2.0.js like this...

//  not enough items
var minimum = (is_number(opts.items.minimum)) ? opts.items.minimum : opts.items.visible + 1;
if (minimum > itms.total)
{
    // e.stopImmediatePropagation();
    // return debug(conf, 'Not enough items ('+itms.total+' total, '+minimum+' needed): Not scrolling.');
}

...it worked for me.

Corey
  • 2,453
  • 4
  • 35
  • 63
-1

Access the wrapper and set its height (assuming all children have the same height):

var carousel = [your_carousel],
    carousel_wrapper = carousel.parent();

carousel_wrapper.height(function(){
  return (carousel.children('[child_selector]').length) * [child_height];
});

The thing here is, there will be a weird behavior when the carousel animates. This is because the maximum height was done ((n-1) * child_height) intentionally as a mask, along with an overflow: hidden.

Another option would be to duplicate one of the children, but that isn't semantic.

skyrider2000
  • 1
  • 1
  • 1
  • 2