Wrong buttons on negative scroll

itarato - August 3, 2009 - 22:01
Project:jCarousel
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi,

I made a jCarousel views and I needed a negative scroll (-1) value. I found the buttons (prev. and next) are not prepared for negative scroll numbers.
Simulate:
1 - create a carousel
2 - set scroll to -1
3 - scroll to an end (first or last)
4 - wrong button will be disabled and backward moving is unable
I made a patch (sorry about the ugly structure, but I hadn't enough time to make a nicer one) which solves the problem. I tested back and forth and it worked for me.

Please, consider to include this feature if you find it useful more than one people.
But if I missed something please let me know.

Best regards,
Peter

AttachmentSize
jcarousel_negative_scroll.patch2.25 KB

#1

itarato - August 5, 2009 - 14:40

Hi,

I played a bit with the module and found another side effect. Although the buttons with the patch above are fine, autoscrolling has an issue when the carousel is loaded. For example:
1 - set the item number to 20
2 - set offset to 20 (begin at the end of the line)
3 - set scroll to -1 (step from end to beginning by 1)
This case the line won't start, because animate() notices jcarousel reached the end of the line. So I modify one extra condition in the animate() function and uploaded the fresh patch.
I think it is rather quick&dirty than elegant (sorry about that), again:(.

Regards,
Peter

AttachmentSize
jcarousel_negative_scroll_2.patch 2.78 KB
 
 

Drupal is a registered trademark of Dries Buytaert.