peachananr / onepage-scroll

Create an Apple-like one page scroller website (iPhone 5S website) with One Page Scroll plugin
http://peachananr.github.io/onepage-scroll/Demo/demo.html
9.54k stars 2.06k forks source link

responsiveFallback problem encountered: multiple swipe event binding #285

Open TommasoBagassi opened 8 years ago

TommasoBagassi commented 8 years ago

I came across a bug when activating the responsiveFallback option: it seemed that if that was set at around 600 i would get multiple swipe events bound (to be precise they would be bound 4 times).

I solved this, at the moment, by unbinding 'touchstart', 'touchmove', 'swipeUp' and 'swipeDown' before binding them (lines 44 and 51 inside swipeEvents, line 249 inside responsive function and 314) For example:

$this.unbind('touchstart').bind('touchstart', touchstart);

Not sure if this is the optimal solution but at the moment it solved the issue

shiv-allva commented 8 years ago

Thanks Tom! it worked for me

burgyl commented 7 years ago

Thank's ! It worked for me too

Le-frenchman commented 6 years ago

Thanks a lot !! Fix works perfectly. Should be added to the source code because it's a huge issue.