/
var
/
www
/
barefootlaw.org
/
wp-content
/
plugins
/
bdthemes-prime-slider-lite
/
assets
/
vendor
/
js
/
Upload File
HOME
/*! * pagepiling.js 1.5.6 * * 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){var a,s=e.fn.pagepiling,c=e(this),r=0,l="ontouchstart"in t||navigator.msMaxTouchPoints>0||navigator.maxTouchPoints,p=0,d=0,v=0,h=0,u=[],f=e.extend(!0,{direction:"vertical",menu:null,verticalCentered:!0,sectionsColor:[],anchors:[],scrollingSpeed:700,easing:"easeInQuart",loopBottom:!1,loopTop:!1,css3:!0,navigation:{textColor:"#000",bulletsColor:"#000",position:"right",tooltips:[]},normalScrollElements:null,normalScrollElementTouchThreshold:5,touchSensitivity:5,keyboardScrolling:!0,sectionSelector:".section",animateAnchor:!1,afterLoad:null,onLeave:null,afterRender:null},i);e.extend(e.easing,{easeInQuart:function(e,n,t,o,i){return o*(n/=i)*n*n*n+t}}),s.setScrollingSpeed=function(e){f.scrollingSpeed=e},s.setMouseWheelScrolling=function(e){e?c.get(0).addEventListener?(c.get(0).addEventListener("mousewheel",C,!1),c.get(0).addEventListener("wheel",C,!1)):c.get(0).attachEvent("onmousewheel",C):c.get(0).addEventListener?(c.get(0).removeEventListener("mousewheel",C,!1),c.get(0).removeEventListener("wheel",C,!1)):c.get(0).detachEvent("onmousewheel",C)},s.setAllowScrolling=function(e){e?(s.setMouseWheelScrolling(!0),function(){if(l){var e=D();c.off("touchstart "+e.down).on("touchstart "+e.down,P),c.off("touchmove "+e.move).on("touchmove "+e.move,Y)}}()):(s.setMouseWheelScrolling(!1),function(){if(l){var e=D();c.off("touchstart "+e.down),c.off("touchmove "+e.move)}}())},s.setKeyboardScrolling=function(e){f.keyboardScrolling=e},s.moveSectionUp=function(){var n=e(".pp-section.active").prev(".pp-section");!n.length&&f.loopTop&&(n=e(".pp-section").last()),n.length&&g(n)},s.moveSectionDown=function(){var n=e(".pp-section.active").next(".pp-section");!n.length&&f.loopBottom&&(n=e(".pp-section").first()),n.length&&g(n)},s.moveTo=function(t){var o="";(o=isNaN(t)?e(n).find('[data-anchor="'+t+'"]'):e(".pp-section").eq(t-1)).length>0&&g(o)},e(f.sectionSelector).each((function(){e(this).addClass("pp-section")})),f.css3&&(f.css3=function(){var e,i=n.createElement("p"),a={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};for(var s in n.body.insertBefore(i,null),a)i.style[s]!==o&&(i.style[s]="translate3d(1px,1px,1px)",e=t.getComputedStyle(i).getPropertyValue(a[s]));return n.body.removeChild(i),e!==o&&e.length>0&&"none"!==e}()),e(c).css({overflow:"hidden","-ms-touch-action":"none","touch-action":"none"}),s.setAllowScrolling(!0),e.isEmptyObject(f.navigation)||function(){e(".bdt-pagepiling-slider").append('<div id="pp-nav"><ul></ul></div>');var n=e("#pp-nav");n.css("color",f.navigation.textColor),n.addClass(f.navigation.position);for(var t=0;t<e(".pp-section").length;t++){var o="";if(f.anchors.length&&(o=f.anchors[t]),"undefined"!==f.navigation.tooltips){var i=f.navigation.tooltips[t];void 0===i&&(i="")}n.find("ul").append('<li data-tooltip="'+i+'"><a href="#'+o+'"><span></span></a></li>')}n.find("span").css("border-color",f.navigation.bulletsColor)}();var m=e(".pp-section").length;function g(n,t){var o,i={destination:n,animated:t,activeSection:e(".pp-section.active"),anchorLink:n.data("anchor"),sectionIndex:n.index(".pp-section"),toMove:n,yMovement:(o=n,e(".pp-section.active").index(".pp-section")>o.index(".pp-section")?"up":"down"),leavingSection:e(".pp-section.active").index(".pp-section")+1};if(!i.activeSection.is(n)){var s,c,l;void 0===i.animated&&(i.animated=!0),void 0!==i.anchorLink&&(s=i.anchorLink,c=i.sectionIndex,f.anchors.length?(location.hash=s,x(location.hash)):x(String(c))),i.destination.addClass("active").siblings().removeClass("active"),i.sectionsToMove=function(n){var t;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)}));return t}(i),"down"===i.yMovement?(i.translate3d=q(),i.scrolling="-100%",f.css3||i.sectionsToMove.each((function(n){n!=i.activeSection.index(".pp-section")&&e(this).css(b(i.scrolling))})),i.animateSection=i.activeSection):(i.translate3d="translate3d(0px, 0px, 0px)",i.scrolling="0",i.animateSection=n),e.isFunction(f.onLeave)&&f.onLeave.call(this,i.leavingSection,i.sectionIndex+1,i.yMovement),function(n){f.css3?(T(n.animateSection,n.translate3d,n.animated),n.sectionsToMove.each((function(){T(e(this),n.translate3d,n.animated)})),setTimeout((function(){S(n)}),f.scrollingSpeed)):(n.scrollOptions=b(n.scrolling),n.animated?n.animateSection.animate(n.scrollOptions,f.scrollingSpeed,f.easing,(function(){w(n),S(n)})):(n.animateSection.css(b(n.scrolling)),setTimeout((function(){w(n),S(n)}),400)))}(i),l=i.anchorLink,f.menu&&(e(f.menu).find(".active").removeClass("active"),e(f.menu).find('[data-menuanchor="'+l+'"]').addClass("active")),function(n,t){f.navigation&&(e("#pp-nav").find(".active").removeClass("active"),n?e("#pp-nav").find('a[href="#'+n+'"]').addClass("active"):e("#pp-nav").find("li").eq(t).find("a").addClass("active"))}(i.anchorLink,i.sectionIndex),a=i.anchorLink;var p=(new Date).getTime();r=p}}function S(n){e.isFunction(f.afterLoad)&&f.afterLoad.call(this,n.anchorLink,n.sectionIndex+1)}function w(n){"up"===n.yMovement&&n.sectionsToMove.each((function(t){e(this).css(b(n.scrolling))}))}function b(e){return"vertical"===f.direction?{top:e}:{left:e}}function x(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 M(){return(new Date).getTime()-r<600+f.scrollingSpeed}function T(e,n,t){e.toggleClass("pp-easing",t),e.css(function(e){return{"-webkit-transform":e,"-moz-transform":e,"-ms-transform":e,transform:e}}(n))}e(".pp-section").each((function(n){e(this).data("data-index",n),e(this).css("z-index",m),n||0!==e(".pp-section.active").length||e(this).addClass("active"),void 0!==f.anchors[n]&&e(this).attr("data-anchor",f.anchors[n]),void 0!==f.sectionsColor[n]&&e(this).css("background-color",f.sectionsColor[n]),f.verticalCentered&&!e(this).hasClass("pp-scrollable")&&e(this).addClass("pp-table").wrapInner('<div class="pp-tableCell" style="height:100%" />'),m-=1})).promise().done((function(){f.navigation&&(e("#pp-nav").css("margin-top","-"+e("#pp-nav").height()/2+"px"),e("#pp-nav").find("li").eq(e(".pp-section.active").index(".pp-section")).find("a").addClass("active")),e(t).on("load",(function(){var o,i;o=t.location.hash.replace("#",""),(i=e(n).find('.pp-section[data-anchor="'+o+'"]')).length>0&&g(i,f.animateAnchor)})),e.isFunction(f.afterRender)&&f.afterRender.call(this)})),e(t).on("hashchange",(function(){var o=t.location.hash.replace("#","").split("/")[0];if(o.length){if(o&&o!==a)g(isNaN(o)?e(n).find('[data-anchor="'+o+'"]'):e(".pp-section").eq(o-1))}})),e(n).keydown((function(n){if(f.keyboardScrolling&&!M())switch(n.which){case 38:case 33:case 37:s.moveSectionUp();break;case 40:case 34:case 39:s.moveSectionDown();break;case 36:s.moveTo(1);break;case 35:s.moveTo(e(".pp-section").length);break;default:return}})),f.normalScrollElements&&(e(n).on("mouseenter",f.normalScrollElements,(function(){s.setMouseWheelScrolling(!1)})),e(n).on("mouseleave",f.normalScrollElements,(function(){s.setMouseWheelScrolling(!0)})));var y=(new Date).getTime();function C(n){var o=(new Date).getTime(),i=(n=n||t.event).wheelDelta||-n.deltaY||-n.detail,a=Math.max(-1,Math.min(1,i)),s=void 0!==n.wheelDeltaX||void 0!==n.deltaX,c=Math.abs(n.wheelDeltaX)<Math.abs(n.wheelDelta)||Math.abs(n.deltaX)<Math.abs(n.deltaY)||!s;u.length>149&&u.shift(),u.push(Math.abs(i));var r=o-y;if(y=o,r>200&&(u=[]),!M()){var l=L(e(".pp-section.active"));return E(u,10)>=E(u,70)&&c&&(a<0?k("down",l):a>0&&k("up",l)),!1}}function E(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 k(e,n){var t,o;if("down"==e?(t="bottom",o=s.moveSectionDown):(t="top",o=s.moveSectionUp),n.length>0){if(!function(e,n){if("top"===e)return!n.scrollTop();if("bottom"===e)return n.scrollTop()+1+n.innerHeight()>=n[0].scrollHeight}(t,n))return!0;o()}else o()}function L(e){return e.filter(".pp-scrollable")}function D(){return t.PointerEvent?{down:"pointerdown",move:"pointermove",up:"pointerup"}:{down:"MSPointerDown",move:"MSPointerMove",up:"MSPointerUp"}}function I(e){var n=new Array;return n.y=void 0!==e.pageY&&(e.pageY||e.pageX)?e.pageY:e.touches[0].pageY,n.x=void 0!==e.pageX&&(e.pageY||e.pageX)?e.pageX:e.touches[0].pageX,n}function X(e){return void 0===e.pointerType||"mouse"!=e.pointerType}function P(e){var n=e.originalEvent;if(X(n)){var t=I(n);p=t.y,d=t.x}}function Y(n){var t=n.originalEvent;if(!N(n.target)&&X(t)){var o=L(e(".pp-section.active"));if(o.length||n.preventDefault(),!M()){var i=I(t);v=i.y,h=i.x,"horizontal"===f.direction&&Math.abs(d-h)>Math.abs(p-v)?Math.abs(d-h)>c.width()/100*f.touchSensitivity&&(d>h?k("down",o):h>d&&k("up",o)):Math.abs(p-v)>c.height()/100*f.touchSensitivity&&(p>v?k("down",o):v>p&&k("up",o))}}}function N(n,t){t=t||0;var o=e(n).parent();return!!(t<f.normalScrollElementTouchThreshold&&o.is(f.normalScrollElements))||t!=f.normalScrollElementTouchThreshold&&N(o,++t)}function q(){return"vertical"!==f.direction?"translate3d(-100%, 0px, 0px)":"translate3d(0px, -100%, 0px)"}e(n).on("click touchstart","#pp-nav a",(function(n){n.preventDefault();var t=e(this).parent().index();g(e(".pp-section").eq(t))})),e(n).on({mouseenter:function(){var n=e(this).data("tooltip");e('<div class="pp-tooltip '+f.navigation.position+'">'+n+"</div>").hide().appendTo(e(this)).fadeIn(200)},mouseleave:function(){e(this).find(".pp-tooltip").fadeOut(200,(function(){e(this).remove()}))}},"#pp-nav li")}}(jQuery,document,window);