Skip to content
Permalink
Browse files

- Fixed bug: not working anymore on smartphones #110

- Fixed bug: doneResizing is not defined #105
  • Loading branch information
alvarotrigo committed Aug 1, 2018
1 parent b5cff48 commit f0fde0687d3bb7ad00c7a90a86bad8d6dd684cbb
Showing with 13 additions and 12 deletions.
  1. +13 −12 jquery.multiscroll.js
@@ -1,5 +1,5 @@
/*!
* multiscroll.js 0.2.1
* multiscroll.js 0.2.2
* https://github.com/alvarotrigo/multiscroll.js
* @license MIT licensed
*
@@ -352,7 +352,7 @@

//if the keyboard is NOT visible
if (!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select')) {
var currentHeight = $window.height();
var currentHeight = $(window).height();

//making sure the change in the viewport size is enough to force a rebuild. (20 % of the window to avoid problems when hidding scroll bars)
if( Math.abs(currentHeight - previousHeight) > (20 * Math.max(previousHeight, currentHeight) / 100) ){
@@ -760,8 +760,7 @@
* This way, the touchstart and the touch moves shows an small difference between them which is the
* used one to determine the direction.
*/
function touchMoveHandler(event){
var e = event.originalEvent;
function touchMoveHandler(e){

if(isReallyTouch(e)){
//preventing the easing on iOS devices
@@ -802,8 +801,7 @@
/**
* Handler to get he coordinates of the starting touch
*/
function touchStartHandler(event){
var e = event.originalEvent;
function touchStartHandler(e){

if(isReallyTouch(e)){
var touchEvents = getEventsPage(e);
@@ -818,8 +816,11 @@
*/
function addTouchHandler(){
if(isTouch || isTouchDevice){
$(document).off(events.touchstart).on(events.touchstart, touchStartHandler);
$(document).off(events.touchmove).on(events.touchmove, touchMoveHandler);
document.removeEventListener(events.touchstart, touchStartHandler);
document.removeEventListener(events.touchmove, touchMoveHandler, {passive: false});

document.addEventListener(events.touchstart, touchStartHandler);
document.addEventListener(events.touchmove, touchMoveHandler, {passive: false});
}
}

@@ -828,8 +829,8 @@
*/
function removeTouchHandler(){
if(isTouch || isTouchDevice){
$(document).off(events.touchstart);
$(document).off(events.touchmove);
document.removeEventListener(events.touchstart, touchStartHandler);
document.removeEventListener(events.touchmove, touchMoveHandler, {passive: false});
}
}

@@ -882,7 +883,7 @@

$(window)
.off('hashchange', hashChangeHandler)
.off('resize', doneResizing);
.off('resize', resizeHandler);

$(document)
.off('mouseenter', '#multiscroll-nav li')
@@ -900,7 +901,7 @@

$(window)
.on('hashchange', hashChangeHandler)
.on('resize', doneResizing);
.on('resize', resizeHandler);

$(document)
.on('mouseenter', '#multiscroll-nav li', navMouseEnterHandler)

0 comments on commit f0fde06

Please sign in to comment.
You can’t perform that action at this time.