Skip to content

Commit

Permalink
- Fixing issue with scrollOverflow extension and touch devices.
Browse files Browse the repository at this point in the history
- Updating version and dist files
  • Loading branch information
alvarotrigo committed Mar 7, 2018
1 parent ef11829 commit b5cff48
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 42 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
![compatibility](http://alvarotrigo.com/multiScroll/imgs/compatible.gif)

---
![multiScroll.js version](http://img.shields.io/badge/multiscroll.js-v0.2.0-brightgreen.svg)
![multiScroll.js version](http://img.shields.io/badge/multiscroll.js-v0.2.1-brightgreen.svg)
[![License](http://img.shields.io/badge/License-MIT-blue.svg)](http://opensource.org/licenses/MIT)
[![PayPal Donate](https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg)](https://www.paypal.me/alvarotrigo/9.95)
   **|**   *3.7Kb gziped*   **|**   *Created by [@imac2](https://twitter.com/imac2)*
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "multiscroll.js",
"version": "0.1.9",
"version": "0.2.1",
"homepage": "http://alvarotrigo.com/multiScroll/",
"authors": [
"Alvaro Trigo https://github.com/alvarotrigo"
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.multiscroll.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* multiscroll.js 0.2.0
* multiscroll.js 0.2.1
* https://github.com/alvarotrigo/multiscroll.js
* @license MIT licensed
*
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.multiscroll.extensions.min.js

Large diffs are not rendered by default.

27 changes: 13 additions & 14 deletions dist/jquery.multiscroll.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* multiscroll.js 0.2.0
* multiscroll.js 0.2.1
* https://github.com/alvarotrigo/multiscroll.js
* @license MIT licensed
*
Expand Down Expand Up @@ -65,6 +65,11 @@
var isMoving = false;
var nav;
var windowHeight = $(window).height();
var MSPointer = getMSPointer();
var events = {
touchmove: 'ontouchmove' in window ? 'touchmove' : MSPointer.move,
touchstart: 'ontouchstart' in window ? 'touchstart' : MSPointer.down
};

//timeouts
var resizeId;
Expand Down Expand Up @@ -812,25 +817,19 @@
* Adds the possibility to auto scroll through sections on touch devices.
*/
function addTouchHandler(){
if(isTouch){
//Microsoft pointers
MSPointer = getMSPointer();

$(document).off('touchstart ' + MSPointer.down).on('touchstart ' + MSPointer.down, touchStartHandler);
$(document).off('touchmove ' + MSPointer.move).on('touchmove ' + MSPointer.move, touchMoveHandler);
if(isTouch || isTouchDevice){
$(document).off(events.touchstart).on(events.touchstart, touchStartHandler);
$(document).off(events.touchmove).on(events.touchmove, touchMoveHandler);
}
}

/**
* Removes the auto scrolling for touch devices.
*/
function removeTouchHandler(){
if(isTouch){
//Microsoft pointers
MSPointer = getMSPointer();

$(document).off('touchstart ' + MSPointer.down);
$(document).off('touchmove ' + MSPointer.move);
if(isTouch || isTouchDevice){
$(document).off(events.touchstart);
$(document).off(events.touchmove);
}
}

Expand Down Expand Up @@ -865,7 +864,7 @@
events.x = (typeof e.pageX !== 'undefined' && (e.pageY || e.pageX) ? e.pageX : e.touches[0].pageX);

//in touch devices with scrollBar:true, e.pageY is detected, but we have to deal with touch events. #1008
if(isTouch && isReallyTouch(e)){
if(isTouch && isReallyTouch(e) && typeof e.touches !== 'undefined'){
events.y = e.touches[0].pageY;
events.x = e.touches[0].pageX;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.multiscroll.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/jquery.multiscroll.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b5cff48

Please sign in to comment.