woocommerce / FlexSlider

An awesome, fully responsive jQuery slider plugin
http://www.woocommerce.com/flexslider/
GNU General Public License v2.0
4.91k stars 1.69k forks source link

add swiping flag property during swipes (#1682), fix broken resize/etc handler (#1665), resolve itemMargin carousel pagination issue (#1480) #1688

Closed RwwL closed 1 month ago

RwwL commented 6 years ago

The reason for adding a swiping property during swipes handled by the touch option is so that swipes can be ignored and not handled as touches/intent to navigate when using the asNav option. Fixes #1682 .

I know you've already got a handle on #1665 but I just thought I'd mention it here because we'd made that fix in parallel in our own repo.

Addresses #1480, where, if you have no maxItems set, the slider.visible calculation could be wrong if a slideMargin value exists.

KZeni commented 4 years ago

If this PR is too much to review & approve... I'd at least like to see https://github.com/woocommerce/FlexSlider/pull/1688/commits/1482f390f9c22991d7732aed69117cc852db4b80 implemented (might need to be updated to the current FlexSlider variables to work, but the idea's the same) if that's more bite-sized for a go-ahead approval/merge/release since that does fix the still-active bug of https://github.com/woocommerce/FlexSlider/issues/1480

Also, the workaround of making sure maxItems is supplied isn't readily available for sites using plugins like MetaSlider & others where that setting isn't shown.

KZeni commented 4 years ago

I might have it where

slider.visible = Math.floor(slider.w/(slider.itemW));

is updated to be

slider.visible = Math.floor(slider.w/(slider.itemW + slideMargin));

instead actually be changed to

slider.visible = slider.itemW > 0 && slider.itemM > 0 ? Math.floor(slider.w / (slider.itemW + slider.itemM)) : Math.floor(slider.w / slider.itemW);

That way, items that don't actually have these values to calculate still use the old/basic setup (I was encountering a browser hang/oddities without that present with multiple sliders on page [some carousels & some not] with some not shown immediately while other are.)