Skip to content
Permalink
Browse files

- Solved problem with navigation bullets #38

- Added compatibility for IE 11 touch screen #34
  • Loading branch information
alvarotrigo committed Feb 18, 2015
1 parent 647fece commit 863f3b8b9413f0c07d0bdcbe6358b3c9a06b7f4a
Showing with 46 additions and 34 deletions.
  1. +1 −1 bower.json
  2. +24 −13 jquery.pagepiling.js
  3. +21 −20 jquery.pagepiling.min.js
@@ -1,6 +1,6 @@
{
"name": "pagePiling.js",
"version": "1.0",
"version": "1.2",
"homepage": "https://github.com/alvarotrigo/pagePiling.js",
"authors": [
"Alvaro Trigo https://github.com/alvarotrigo"
@@ -1,5 +1,5 @@
/* ===========================================================
* pagepiling.js 1.0
* pagepiling.js 1.2
*
* https://github.com/alvarotrigo/pagePiling.js
* MIT licensed
@@ -9,7 +9,7 @@
* ========================================================== */

(function ($) {
$.fn.pagepiling = function (options) {
$.fn.pagepiling = function (custom) {
var container = $(this);
var lastScrolledDestiny;
var lastAnimation = 0;
@@ -22,7 +22,7 @@
var scrollDelay = 600;

// Create some defaults, extending them with any options that were provided
options = $.extend({
options = $.extend(true, {
direction: 'vertical',
menu: null,
verticalCentered: true,
@@ -34,10 +34,10 @@
loopTop: false,
css3: true,
navigation: {
'textColor': '#000',
'bulletsColor': '#000',
'position': 'right',
'tooltips': ['section1', 'section2', 'section3', 'section4']
textColor: '#000',
bulletsColor: '#000',
position: 'right',
tooltips: null
},
normalScrollElements: null,
normalScrollElementTouchThreshold: 5,
@@ -50,7 +50,7 @@
afterLoad: null,
onLeave: null,
afterRender: null
}, options);
}, custom);


//easeInQuart animation included in the plugin
@@ -709,15 +709,26 @@
return events;
}

/**
* As IE >= 10 fires both touch and mouse events when using a mouse in a touchscreen
* this way we make sure that is really a touch event what IE is detecting.
*/
function isReallyTouch(e){
//if is not IE || IE is detecting `touch` or `pen`
return typeof e.pointerType === 'undefined' || e.pointerType != 'mouse';
}

/**
* Getting the starting possitions of the touch event
*/
function touchStartHandler(event){

var e = event.originalEvent;
var touchEvents = getEventsPage(e);
touchStartY = touchEvents['y'];
touchStartX = touchEvents['x'];

if(isReallyTouch(e)){
var touchEvents = getEventsPage(e);
touchStartY = touchEvents['y'];
touchStartX = touchEvents['x'];
}
}

/* Detecting touch events
@@ -726,7 +737,7 @@
var e = event.originalEvent;

// additional: if one of the normalScrollElements isn't within options.normalScrollElementTouchThreshold hops up the DOM chain
if (!checkParentForNormalScrollElement(event.target)) {
if ( !checkParentForNormalScrollElement(event.target) && isReallyTouch(e) ) {
event.preventDefault();

var activeSection = $('.pp-section.active');

0 comments on commit 863f3b8

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