From e2c1088beee92d331541813ac8df6bb09c2b7a78 Mon Sep 17 00:00:00 2001 From: shpontex Date: Sat, 14 Mar 2015 14:55:31 +0900 Subject: [PATCH] bug fix prevent window from dragging in mobile browser fix bug in mobile scroll : (when multiple touch and scroll it scroll as how many touch you did ) fix bug : weird scroll in mobile device when one page scroll is off --- Demo/demo.html | 3 +++ jquery.onepage-scroll.js | 2 +- onepage-scroll.css | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Demo/demo.html b/Demo/demo.html index 333c7e6..9147ef0 100644 --- a/Demo/demo.html +++ b/Demo/demo.html @@ -377,6 +377,9 @@ sectionContainer: "section", responsiveFallback: 600, loop: true + }); + $('body').bind('touchmove', function (ev) { + ev.preventDefault(); }); }); diff --git a/jquery.onepage-scroll.js b/jquery.onepage-scroll.js index 71c75ba..d16222d 100644 --- a/jquery.onepage-scroll.js +++ b/jquery.onepage-scroll.js @@ -48,7 +48,7 @@ if (touches && touches.length) { startX = touches[0].pageX; startY = touches[0].pageY; - $this.bind('touchmove', touchmove); + $this.unbind('touchmove', touchmove).bind('touchmove', touchmove); } } diff --git a/onepage-scroll.css b/onepage-scroll.css index 3d4415f..432e1b3 100644 --- a/onepage-scroll.css +++ b/onepage-scroll.css @@ -1,6 +1,5 @@ body, html { margin: 0; - overflow: hidden; -webkit-transition: opacity 400ms; -moz-transition: opacity 400ms; transition: opacity 400ms; @@ -69,7 +68,7 @@ body, .onepage-wrapper, html { } .disabled-onepage-scroll, .disabled-onepage-scroll .wrapper { - overflow: auto; + } .disabled-onepage-scroll .onepage-wrapper .section {