Hi,

On 12 Apr., 21:13, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> Klaus Hartl schrieb:
>
> > Here's what I did - it's a hack and you could do better but it works for
> > now and you get the picture:
>
> > I added a flexibleWidth option and than added the following lines to the
> > init method:
>
> > // Mod - allow flexible width
> > if (priv.o.flexibleWidth)
> >     jQuery(window).bind('resize', function() {
> >         var jCarouselClip = jQuery(".jcarousel-clip", priv.scope);
> >         var jCarouselClipAvailWidth =
> > parseInt(jCarouselClip[0].parentNode.offsetWidth - 2 * 40);
> >         jCarouselClip.css({ width: jCarouselClipAvailWidth });
> >         jCarouselClip.find('li').css({ width:
> > Math.ceil(jCarouselClipAvailWidth / priv.o.itemVisible) });
> >         priv.dimension = i.offsetWidth + priv.margin(i, "marginLeft") +
> > priv.margin(i, "marginRight");
> >         priv.resize();
> >         priv.animate(); // readjust left positioning
> >     });
>
> > Would be cool if you could add that in a more proper way if you like
> > that :-)
>
> Scratch that "2 * 40", that is special to my project, just needed to get
> that in as fast as possible...:
>
> var jCarouselClipAvailWidth = jCarouselClip[0].parentNode.offsetWidth;
>
> -- Klaus

ok, i see now. One of the main differences between the old and the new
version of jCarousel is, that you no longer have to pass itemsVisible
as option. The number of visible items are calculated on the fly
depending on the sizes of the clip and the items. I've done that
mainly to allow items of different sizes and a flexible carousel
width. But i never thought about your special case ;)

In the new new version, you can do it with the callback functions
(i've adjusted the example posted before) but its also a little bit
hackish.

So, in short, i don't have a built-in solution right now but i keep
that in mind...

Jan

Reply via email to