historia-de-zainab/bower_components/pagePiling.js/dist/jquery.pagepiling.min.js

11 lines
10 KiB
JavaScript
Raw Normal View History

2017-09-25 14:03:53 +02:00
/*!
* pagepiling.js 1.5.4
*
* https://github.com/alvarotrigo/pagePiling.js
* @license MIT licensed
*
* Copyright (C) 2016 alvarotrigo.com - A project by Alvaro Trigo
*/
!function(e,n,t,o){"use strict";e.fn.pagepiling=function(i){function a(e){e.addClass("pp-table").wrapInner('<div class="pp-tableCell" style="height:100%" />')}function s(n){var t=e(".pp-section.active").index(".pp-section"),o=n.index(".pp-section");return t>o?"up":"down"}function c(n,t){var o={destination:n,animated:t,activeSection:e(".pp-section.active"),anchorLink:n.data("anchor"),sectionIndex:n.index(".pp-section"),toMove:n,yMovement:s(n),leavingSection:e(".pp-section.active").index(".pp-section")+1};if(!o.activeSection.is(n)){"undefined"==typeof o.animated&&(o.animated=!0),"undefined"!=typeof o.anchorLink&&v(o.anchorLink,o.sectionIndex),o.destination.addClass("active").siblings().removeClass("active"),o.sectionsToMove=p(o),"down"===o.yMovement?(o.translate3d=U(),o.scrolling="-100%",Z.css3||o.sectionsToMove.each(function(n){n!=o.activeSection.index(".pp-section")&&e(this).css(u(o.scrolling))}),o.animateSection=o.activeSection):(o.translate3d="translate3d(0px, 0px, 0px)",o.scrolling="0",o.animateSection=n),e.isFunction(Z.onLeave)&&Z.onLeave.call(this,o.leavingSection,o.sectionIndex+1,o.yMovement),r(o),A(o.anchorLink),z(o.anchorLink,o.sectionIndex),W=o.anchorLink;var i=(new Date).getTime();Q=i}}function r(n){Z.css3?(w(n.animateSection,n.translate3d,n.animated),n.sectionsToMove.each(function(){w(e(this),n.translate3d,n.animated)}),setTimeout(function(){l(n)},Z.scrollingSpeed)):(n.scrollOptions=u(n.scrolling),n.animated?n.animateSection.animate(n.scrollOptions,Z.scrollingSpeed,Z.easing,function(){d(n),l(n)}):(n.animateSection.css(u(n.scrolling)),setTimeout(function(){d(n),l(n)},400)))}function l(n){e.isFunction(Z.afterLoad)&&Z.afterLoad.call(this,n.anchorLink,n.sectionIndex+1)}function p(n){var t;return t="down"===n.yMovement?e(".pp-section").map(function(t){if(t<n.destination.index(".pp-section"))return e(this)}):e(".pp-section").map(function(t){if(t>n.destination.index(".pp-section"))return e(this)})}function d(n){"up"===n.yMovement&&n.sectionsToMove.each(function(t){e(this).css(u(n.scrolling))})}function u(e){return"vertical"===Z.direction?{top:e}:{left:e}}function v(e,n){Z.anchors.length?(location.hash=e,f(location.hash)):f(String(n))}function f(n){n=n.replace("#",""),e("body")[0].className=e("body")[0].className.replace(/\b\s?pp-viewing-[^\s]+\b/g,""),e("body").addClass("pp-viewing-"+n)}function h(){var o=t.location.hash.replace("#",""),i=o,a=e(n).find('.pp-section[data-anchor="'+i+'"]');a.length>0&&c(a,Z.animateAnchor)}function m(){var e=(new Date).getTime();return e-Q<J+Z.scrollingSpeed}function g(){var o=t.location.hash.replace("#","").split("/"),i=o[0];if(i.length&&i&&i!==W){var a;a=isNaN(i)?e(n).find('[data-anchor="'+i+'"]'):e(".pp-section").eq(i-1),c(a)}}function S(e){return{"-webkit-transform":e,"-moz-transform":e,"-ms-transform":e,transform:e}}function w(e,n,t){e.toggleClass("pp-easing",t),e.css(S(n))}function b(n){var o=(new Date).getTime();n=n||t.event;var i=n.wheelDelta||-n.deltaY||-n.detail,a=Math.max(-1,Math.min(1,i)),s="undefined"!=typeof n.wheelDeltaX||"undefined"!=typeof n.deltaX,c=Math.abs(n.wheelDeltaX)<Math.abs(n.wheelDelta)||Math.abs(n.deltaX)<Math.abs(n.deltaY)||!s;G.length>149&&G.shift(),G.push(Math.abs(i));var r=o-_;if(_=o,r>200&&(G=[]),!m()){var l=e(".pp-section.active"),p=T(l),d=y(G,10),u=y(G,70),v=d>=u;return v&&c&&(a<0?x("down",p):a>0&&x("up",p)),!1}}function y(e,n){for(var t=0,o=e.slice(Math.max(e.length-n,1)),i=0;i<o.length;i++)t+=o[i];return Math.ceil(t/n)}function x(e,n){var t,o;if("down"==e?(t="bottom",o=B.moveSectionDown):(t="top",o=B.moveSectionUp),n.length>0){if(!M(t,n))return!0;o()}else o()}function M(e,n){return"top"===e?!n.scrollTop():"bottom"===e?n.scrollTop()+1+n.innerHeight()>=n[0].scrollHeight:void 0}function T(e){return e.filter(".pp-scrollable")}function C(){F.get(0).addEventListener?(F.get(0).removeEventListener("mousewheel",b,!1),F.get(0).removeEventListener("wheel",b,!1)):F.get(0).detachEvent("onmousewheel",b)}function k(){F.get(0).addEventListener?(F.get(0).addEventListener("mousewheel",b,!1),F.get(0).addEventListener("wheel",b,!1)):F.get(0).attachEvent("onmousewheel",
//# sourceMappingURL=jquery.pagepiling.min.js.map