Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
On theme/infiniteCarousel.js file:
When we have float result on $wrapper.innerWidth() / singleWidth
(Example : 5.5), we should take floor value and not ceil.
Actually, if $wrapper.innerWidth() / singleWidth == 5.5
, visible = Math.ceil(5.5) = 6
This means we display 6 elements. It's wrong, we display 5.5 (or less) elements. One thing is sure, 6th element is not full displayed, so we should have visible = 5 to be sure to display 6th element first next page.
So to have this result, we should use Math.floor() instead of Math.ceil()
Patch in next comment
Comment | File | Size | Author |
---|---|---|---|
#2 | galleryformatter-math.ceil-and-pagination-infinite-carousel-2044143-1.patch | 957 bytes | GoZ |
#1 | galleryformatter-math.ceil-and-pagination-infinite-carousel-2044143-1.patch | 957 bytes | GoZ |
Comments
Comment #1
GoZ CreditAttribution: GoZ commentedHere is the patch
Comment #2
GoZ CreditAttribution: GoZ commentedHere is the patch
*edit* double post due to browser error
Comment #3
kscheirerLooks good to me.
Comment #5
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer commentedThanks, committed. Sorry for taking so long!