1/*------------------------------------------------------------------------- 2 3 1. Plugin Init 4 2. Helper Functions 5 3. Shortcode Stuff 6 4. Header + Search 7 5. Page Specific 8 6. Scroll to top 9 7. Cross Browser Fixes 10 11 12-------------------------------------------------------------------------*/ 13 14 15/*-------------------------------------------------------------------------*/ 16/* 1. Plugin Init 17/*-------------------------------------------------------------------------*/ 18 19 20/* Touch swipe */ 21(function(d){var m="left",l="right",c="up",s="down",b="in",t="out",j="none",o="auto",i="swipe",p="pinch",u="tap",x="horizontal",q="vertical",g="all",e="start",h="move",f="end",n="cancel",a="ontouchstart" in window,v="TouchSwipe";var k={fingers:1,threshold:75,cancelThreshold:25,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,triggerOnTouchEnd:true,triggerOnTouchLeave:false,allowPageScroll:"auto",fallbackToMouseEvents:true,excludedElements:"button, input, select, textarea, a, .noSwipe"};d.fn.swipe=function(A){var z=d(this),y=z.data(v);if(y&&typeof A==="string"){if(y[A]){return y[A].apply(this,Array.prototype.slice.call(arguments,1))}else{d.error("Method "+A+" does not exist on jQuery.swipe")}}else{if(!y&&(typeof A==="object"||!A)){return r.apply(this,arguments)}}return z};d.fn.swipe.defaults=k;d.fn.swipe.phases={PHASE_START:e,PHASE_MOVE:h,PHASE_END:f,PHASE_CANCEL:n};d.fn.swipe.directions={LEFT:m,RIGHT:l,UP:c,DOWN:s,IN:b,OUT:t};d.fn.swipe.pageScroll={NONE:j,HORIZONTAL:x,VERTICAL:q,AUTO:o};d.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,ALL:g};function r(y){if(y&&(y.allowPageScroll===undefined&&(y.swipe!==undefined||y.swipeStatus!==undefined))){y.allowPageScroll=j}if(y.click!==undefined&&y.tap===undefined){y.tap=y.click}if(!y){y={}}y=d.extend({},d.fn.swipe.defaults,y);return this.each(function(){var A=d(this);var z=A.data(v);if(!z){z=new w(this,y);A.data(v,z)}})}function w(S,ag){var aJ=(a||!ag.fallbackToMouseEvents),az=aJ?"touchstart":"mousedown",U=aJ?"touchmove":"mousemove",av=aJ?"touchend":"mouseup",D=aJ?null:"mouseleave",R="touchcancel";var ad=0,N=null,ah=0,aF=0,A=0,aj=1,aA=0,aN=0,Z=null;var H=d(S);var O="start";var aI=0;var ai=null;var I=0,Y=0,aD=0,aP=0;try{H.bind(az,at);H.bind(R,L)}catch(aG){d.error("events not supported "+az+","+R+" on jQuery.swipe")}this.enable=function(){H.bind(az,at);H.bind(R,L);return H};this.disable=function(){Q();return H};this.destroy=function(){Q();H.data(v,null);return H};this.option=function(aR,aQ){if(ag[aR]!==undefined){if(aQ===undefined){return ag[aR]}else{ag[aR]=aQ}}else{d.error("Option "+aR+" does not exist on jQuery.swipe.options")}};function at(aS){if(X()){return}if(d(aS.target).closest(ag.excludedElements,H).length>0){return}var aT=aS.originalEvent?aS.originalEvent:aS;var aR,aQ=a?aT.touches[0]:aT;O=e;if(a){aI=aT.touches.length}else{aS.preventDefault()}ad=0;N=null;aN=null;ah=0;aF=0;A=0;aj=1;aA=0;ai=T();Z=aE();z();if(!a||(aI===ag.fingers||ag.fingers===g)||ap()){aO(0,aQ);I=B();if(aI==2){aO(1,aT.touches[1]);aF=A=aa(ai[0].start,ai[1].start)}if(ag.swipeStatus||ag.pinchStatus){aR=aH(aT,O)}}else{aR=false}if(aR===false){O=n;aH(aT,O);return aR}else{ak(true)}}function P(aT){var aW=aT.originalEvent?aT.originalEvent:aT;if(O===f||O===n||af()){return}var aS,aR=a?aW.touches[0]:aW;var aU=V(aR);Y=B();if(a){aI=aW.touches.length}O=h;if(aI==2){if(aF==0){aO(1,aW.touches[1]);aF=A=aa(ai[0].start,ai[1].start)}else{V(aW.touches[1]);A=aa(ai[0].end,ai[1].end);aN=ao(ai[0].end,ai[1].end)}aj=y(aF,A);aA=Math.abs(aF-A)}if((aI===ag.fingers||ag.fingers===g)||!a||ap()){N=ar(aU.start,aU.end);C(aT,N);ad=G(aU.start,aU.end);ah=K();aK(N,ad);if(ag.swipeStatus||ag.pinchStatus){aS=aH(aW,O)}if(!ag.triggerOnTouchEnd||ag.triggerOnTouchLeave){var aQ=true;if(ag.triggerOnTouchLeave){var aV=au(this);aQ=aC(aU.end,aV)}if(!ag.triggerOnTouchEnd&&aQ){O=aM(h)}else{if(ag.triggerOnTouchLeave&&!aQ){O=aM(f)}}if(O==n||O==f){aH(aW,O)}}}else{O=n;aH(aW,O)}if(aS===false){O=n;aH(aW,O)}}function ab(aS){var aU=aS.originalEvent;if(a){if(aU.touches.length>0){aw();return true}}if(af()){aI=aP}aS.preventDefault();Y=B();if(ag.triggerOnTouchEnd||(ag.triggerOnTouchEnd==false&&O===h)){O=f;var aR=((aI===ag.fingers||ag.fingers===g)||!a);var aQ=ai[0].end.x!==0;var aT=aR&&aQ&&(an()||aB());if(aT){aH(aU,O)}else{O=n;aH(aU,O)}}else{if(!ag.triggerOnTouchEnd&&ay()){O=f;am(aU,O,u)}else{if(O===h){O=n;aH(aU,O)}}}ak(false)}function L(){aI=0;Y=0;I=0;aF=0;A=0;aj=1;z();ak(false)}function W(aQ){var aR=aQ.originalEvent;if(ag.triggerOnTouchLeave){O=aM(f);aH(aR,O)}}function Q(){H.unbind(az,at);H.unbind(R,L);H.unbind(U,P);H.unbind(av,ab);if(D){H.unbind(D,W)}ak(false)}function aM(aT){var aS=aT;var aR=aq();var aQ=ae();if(!aR){aS=n}else{if(aQ&&aT==h&&(!ag.triggerOnTouchEnd||ag.triggerOnTouchLeave)){aS=f}else{if(!aQ&&aT==f&&ag.triggerOnTouchLeave){aS=n}}}return aS}function aH(aS,aQ){var aR=undefined;if(ac()){aR=am(aS,aQ,i)}if(ap()&&aR!==false){aR=am(aS,aQ,p)}
21if(ay()&&aR!==false){aR=am(aS,aQ,u)}if(aQ===n){L(aS)}if(aQ===f){if(a){if(aS.touches.length==0){L(aS)}}else{L(aS)}}return aR}function am(aT,aQ,aS){var aR=undefined;if(aS==i){H.trigger("swipeStatus",[aQ,N||null,ad||0,ah||0,aI]);if(ag.swipeStatus){aR=ag.swipeStatus.call(H,aT,aQ,N||null,ad||0,ah||0,aI);if(aR===false){return false}}if(aQ==f&&aB()){H.trigger("swipe",[N,ad,ah,aI]);if(ag.swipe){aR=ag.swipe.call(H,aT,N,ad,ah,aI);if(aR===false){return false}}switch(N){case m:H.trigger("swipeLeft",[N,ad,ah,aI]);if(ag.swipeLeft){aR=ag.swipeLeft.call(H,aT,N,ad,ah,aI)}break;case l:H.trigger("swipeRight",[N,ad,ah,aI]);if(ag.swipeRight){aR=ag.swipeRight.call(H,aT,N,ad,ah,aI)}break;case c:H.trigger("swipeUp",[N,ad,ah,aI]);if(ag.swipeUp){aR=ag.swipeUp.call(H,aT,N,ad,ah,aI)}break;case s:H.trigger("swipeDown",[N,ad,ah,aI]);if(ag.swipeDown){aR=ag.swipeDown.call(H,aT,N,ad,ah,aI)}break}}}if(aS==p){H.trigger("pinchStatus",[aQ,aN||null,aA||0,ah||0,aI,aj]);if(ag.pinchStatus){aR=ag.pinchStatus.call(H,aT,aQ,aN||null,aA||0,ah||0,aI,aj);if(aR===false){return false}}if(aQ==f&&an()){switch(aN){case b:H.trigger("pinchIn",[aN||null,aA||0,ah||0,aI,aj]);if(ag.pinchIn){aR=ag.pinchIn.call(H,aT,aN||null,aA||0,ah||0,aI,aj)}break;case t:H.trigger("pinchOut",[aN||null,aA||0,ah||0,aI,aj]);if(ag.pinchOut){aR=ag.pinchOut.call(H,aT,aN||null,aA||0,ah||0,aI,aj)}break}}}if(aS==u){if(aQ===n||aQ===f){if((aI===1||!a)&&(isNaN(ad)||ad===0)){H.trigger("tap",[aT.target]);if(ag.tap){aR=ag.tap.call(H,aT,aT.target)}}}}return aR}function ae(){var aQ=true;if(ag.threshold!==null){aQ=ad>=ag.threshold}if(aQ&&ag.cancelThreshold!==null){aQ=(M(N)-ad)<ag.cancelThreshold}return aQ}function al(){if(ag.pinchThreshold!==null){return aA>=ag.pinchThreshold}return true}function aq(){var aQ;if(ag.maxTimeThreshold){if(ah>=ag.maxTimeThreshold){aQ=false}else{aQ=true}}else{aQ=true}return aQ}function C(aQ,aR){if(ag.allowPageScroll===j||ap()){aQ.preventDefault()}else{var aS=ag.allowPageScroll===o;switch(aR){case m:if((ag.swipeLeft&&aS)||(!aS&&ag.allowPageScroll!=x)){aQ.preventDefault()}break;case l:if((ag.swipeRight&&aS)||(!aS&&ag.allowPageScroll!=x)){aQ.preventDefault()}break;case c:if((ag.swipeUp&&aS)||(!aS&&ag.allowPageScroll!=q)){aQ.preventDefault()}break;case s:if((ag.swipeDown&&aS)||(!aS&&ag.allowPageScroll!=q)){aQ.preventDefault()}break}}}function an(){return al()}function ap(){return !!(ag.pinchStatus||ag.pinchIn||ag.pinchOut)}function ax(){return !!(an()&&ap())}function aB(){var aQ=aq();var aS=ae();var aR=aS&&aQ;return aR}function ac(){return !!(ag.swipe||ag.swipeStatus||ag.swipeLeft||ag.swipeRight||ag.swipeUp||ag.swipeDown)}function E(){return !!(aB()&&ac())}function ay(){return !!(ag.tap)}function aw(){aD=B();aP=event.touches.length+1}function z(){aD=0;aP=0}function af(){var aQ=false;if(aD){var aR=B()-aD;if(aR<=ag.fingerReleaseThreshold){aQ=true}}return aQ}function X(){return !!(H.data(v+"_intouch")===true)}function ak(aQ){if(aQ===true){H.bind(U,P);H.bind(av,ab);if(D){H.bind(D,W)}}else{H.unbind(U,P,false);H.unbind(av,ab,false);if(D){H.unbind(D,W,false)}}H.data(v+"_intouch",aQ===true)}function aO(aR,aQ){var aS=aQ.identifier!==undefined?aQ.identifier:0;ai[aR].identifier=aS;ai[aR].start.x=ai[aR].end.x=aQ.pageX||aQ.clientX;ai[aR].start.y=ai[aR].end.y=aQ.pageY||aQ.clientY;return ai[aR]}function V(aQ){var aS=aQ.identifier!==undefined?aQ.identifier:0;var aR=J(aS);aR.end.x=aQ.pageX||aQ.clientX;aR.end.y=aQ.pageY||aQ.clientY;return aR}function J(aR){for(var aQ=0;aQ<ai.length;aQ++){if(ai[aQ].identifier==aR){return ai[aQ]}}}function T(){var aQ=[];for(var aR=0;aR<=5;aR++){aQ.push({start:{x:0,y:0},end:{x:0,y:0},identifier:0})}return aQ}function aK(aQ,aR){aR=Math.max(aR,M(aQ));Z[aQ].distance=aR}function M(aQ){return Z[aQ].distance}function aE(){var aQ={};aQ[m]=aL(m);aQ[l]=aL(l);aQ[c]=aL(c);aQ[s]=aL(s);return aQ}function aL(aQ){return{direction:aQ,distance:0}}function K(){return Y-I}function aa(aT,aS){var aR=Math.abs(aT.x-aS.x);var aQ=Math.abs(aT.y-aS.y);return Math.round(Math.sqrt(aR*aR+aQ*aQ))}function y(aQ,aR){var aS=(aR/aQ)*1;return aS.toFixed(2)}function ao(){if(aj<1){return t}else{return b}}function G(aR,aQ){return Math.round(Math.sqrt(Math.pow(aQ.x-aR.x,2)+Math.pow(aQ.y-aR.y,2)))}function F(aT,aR){var aQ=aT.x-aR.x;var aV=aR.y-aT.y;var aS=Math.atan2(aV,aQ);var aU=Math.round(aS*180/Math.PI);if(aU<0){aU=360-Math.abs(aU)}return aU}function ar(aR,aQ){var aS=F(aR,aQ);if((aS<=45)&&(aS>=0)){return m}else{if((aS<=360)&&(aS>=315)){return m}else{if((aS>=135)&&(aS<=225)){return l}else{if((aS>45)&&(aS<135)){return s}else{return c}}}}}function B(){var aQ=new Date();return aQ.getTime()}function au(aQ){aQ=d(aQ);var aS=aQ.offset();var aR={left:aS.left,right:aS.left+aQ.outerWidth(),top:aS.top,bottom:aS.top+aQ.outerHeight()};return aR}function aC(aQ,aR){return(aQ.x>aR.left&&aQ.x<aR.right&&aQ.y>aR.top&&aQ.y<aR.bottom)}}})(jQuery); 22 23 24/*! 25 * imagesLoaded PACKAGED v3.1.1 26 * JavaScript is all like "You images are done yet or what?" 27 * MIT License 28 */ 29 30(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1
30);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e){function t(e,t){for(var n in t)e[n]=t[n];return e}function n(e){return"[object Array]"===f.call(e)}function i(e){var t=[];if(n(e))t=e;else if("number"==typeof e.length)for(var i=0,r=e.length;r>i;i++)t.push(e[i]);else t.push(e);return t}function r(e,n){function r(e,n,s){if(!(this instanceof r))return new r(e,n);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=i(e),this.options=t({},this.options),"function"==typeof n?s=n:t(this.options,n),s&&this.on("always",s),this.getImages(),o&&(this.jqDeferred=new o.Deferred);var c=this;setTimeout(function(){c.check()})}function f(e){this.img=e}function a(e){this.src=e,h[e]=this}r.prototype=new e,r.prototype.options={},r.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);for(var i=n.querySelectorAll("img"),r=0,o=i.length;o>r;r++){var s=i[r];this.addImage(s)}}},r.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},r.prototype.check=function(){function e(e,r){return t.options.debug&&c&&s.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},r.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify(t,e)})},r.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},o&&(o.fn.imagesLoaded=function(e,t){var n=new r(this,e,t);return n.jqDeferred.promise(o(this))}),f.prototype=new e,f.prototype.check=function(){var e=h[this.img.src]||new a(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var h={};return a.prototype=new e,a.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},a.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},a.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},a.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},a.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},a.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},r}var o=e.jQuery,s=e.console,c=s!==void 0,f=Object.prototype.toString;"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],r):e.imagesLoaded=r(e.EventEmitter,e.eventie)}(window); 31 32 33/*jQuery Waypoints */ 34!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");
vendor: 6,526 bytes, line 34
34this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
34ight:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jQuery,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); 35 36/* 37* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ 38*/ 39 40jQuery.easing["jswing"]=jQuery.easing["swing"];jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e)==1)return c+d;if(!g)g=e*.3;if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e)==1)return c+d;if(!g)g=e*.3;if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;if(!g)g=e*.3*1.5;if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);if(b<1)return-.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c;return h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,b,c,d,e,f){if(f==undefined)f=1.70158;return d*(b/=e)*b*((f+1)*b-f)+c},easeOutBack:function(a,b,c,d,e,f){if(f==undefined)f=1.70158;return d*((b=b/e-1)*b*((f+1)*b+f)+1)+c},easeInOutBack:function(a,b,c,d,e,f){if(f==undefined)f=1.70158;if((b/=e/2)<1)return d/2*b*b*(((f*=1.525)+1)*b-f)+c;return d/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c},easeInBounce:function(a,b,c,d,e){return d-jQuery.easing.easeOutBounce(a,e-b,0,d,e)+c}
40,easeOutBounce:function(a,b,c,d,e){if((b/=e)<1/2.75){return d*7.5625*b*b+c}else if(b<2/2.75){return d*(7.5625*(b-=1.5/2.75)*b+.75)+c}else if(b<2.5/2.75){return d*(7.5625*(b-=2.25/2.75)*b+.9375)+c}else{return d*(7.5625*(b-=2.625/2.75)*b+.984375)+c}},easeInOutBounce:function(a,b,c,d,e){if(b<e/2)return jQuery.easing.easeInBounce(a,b*2,0,d,e)*.5+c;return jQuery.easing.easeOutBounce(a,b*2-e,0,d,e)*.5+d*.5+c}}) 41 42 43/*! Mousewheel by Brandon Aaron (http://brandon.aaron.sh) */ 44!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}); 45 46 47/* 48 * jQuery FlexSlider v2.1 49 * http://www.woothemes.com/flexslider/ 50 * 51 * Copyright 2012 WooThemes 52 * Free to use under the GPLv2 license. 53 * http://www.gnu.org/licenses/gpl-2.0.html 54 * 55 * Contributing author: Tyler Smith (@mbmufffin) 56 */ 57!function(e){e.flexslider=function(t,n){var a=e(t),i=e.extend({},e.flexslider.defaults,n),o=i.namespace,s="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,r=s?"touchend":"click",l="vertical"===i.direction,c=i.reverse,d=0<i.itemWidth,u="fade"===i.animation,p=""!==i.asNavFor,m={};e.data(t,"flexslider",a),m={init:function(){a.animating=!1,a.currentSlide=i.startAt,a.animatingTo=a.currentSlide,a.atEnd=0===a.currentSlide||a.currentSlide===a.last,a.containerSelector=i.selector.substr(0,i.selector.search(" ")),a.slides=e(i.selector,a),a.container=e(a.containerSelector,a),a.count=a.slides.length,a.syncExists=0<e(i.sync).length,"slide"===i.animation&&(i.animation="swing"),a.prop=l?"top":"marginLeft",a.args={},a.manualPause=!1;var t,n=a;
57if((t=!i.video)&&(t=!u)&&(t=i.useCSS))e:{t=document.createElement("div");var o,r=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(o in r)if(void 0!==t.style[r[o]]){a.pfx=r[o].replace("Perspective","").toLowerCase(),a.prop="-"+a.pfx+"-transform",t=!0;break e}t=!1}n.transitions=t,""!==i.controlsContainer&&(a.controlsContainer=0<e(i.controlsContainer).length&&e(i.controlsContainer)),""!==i.manualControls&&(a.manualControls=0<e(i.manualControls).length&&e(i.manualControls)),i.randomize&&(a.slides.sort(function(){return Math.round(Math.random())-.5}),a.container.empty().append(a.slides)),a.doMath(),p&&m.asNav.setup(),a.setup("init"),i.controlNav&&m.controlNav.setup(),i.directionNav&&m.directionNav.setup(),i.keyboard&&(1===e(a.containerSelector).length||i.multipleKeyboard)&&e(document).bind("keyup",function(e){e=e.keyCode,a.animating||39!==e&&37!==e||(e=39===e?a.getTarget("next"):37===e?a.getTarget("prev"):!1,a.flexAnimate(e,i.pauseOnAction))}),i.mousewheel&&a.bind("mousewheel",function(e,t){e.preventDefault();var n=a.getTarget(0>t?"next":"prev");a.flexAnimate(n,i.pauseOnAction)}),i.pausePlay&&m.pausePlay.setup(),i.slideshow&&(i.pauseOnHover&&a.hover(function(){!a.manualPlay&&!a.manualPause&&a.pause()},function(){!a.manualPause&&!a.manualPlay&&a.play()}),0<i.initDelay?setTimeout(a.play,i.initDelay):a.play()),s&&i.touch&&m.touch(),(!u||u&&i.smoothHeight)&&e(window).bind("resize focus",m.resize),setTimeout(function(){i.start(a)},200)},asNav:{setup:function(){a.asNav=!0,a.animatingTo=Math.floor(a.currentSlide/a.move),a.currentItem=a.currentSlide,a.slides.removeClass(o+"active-slide").eq(a.currentItem).addClass(o+"active-slide"),a.slides.click(function(t){t.preventDefault(),t=e(this);var n=t.index();!e(i.asNavFor).data("flexslider").animating&&!t.hasClass("active")&&(a.direction=a.currentItem<n?"next":"prev",a.flexAnimate(n,i.pauseOnAction,!1,!0,!0))})}},controlNav:{setup:function(){a.manualControls?m.controlNav.setupManual():m.controlNav.setupPaging()},setupPaging:function(){var t,n=1;if(a.controlNavScaffold=e('<ol class="'+o+"control-nav "+o+("thumbnails"===i.controlNav?"control-thumbs":"control-paging")+'"></ol>'),1<a.pagingCount)for(var l=0;l<a.pagingCount;l++)t="thumbnails"===i.controlNav?'<img src="'+a.slides.eq(l).attr("data-thumb")+'"/>':"<a>"+n+"</a>",a.controlNavScaffold.append("<li>"+t+"</li>"),n++;a.controlsContainer?e(a.controlsContainer).append(a.controlNavScaffold):a.append(a.controlNavScaffold),m.controlNav.set(),m.controlNav.active(),a.controlNavScaffold.delegate("a, img",r,function(t){t.preventDefault(),t=e(this);var n=a.controlNav.index(t);t.hasClass(o+"active")||(a.direction=n>a.currentSlide?"next":"prev",a.flexAnimate(n,i.pauseOnAction))}),s&&a.controlNavScaffold.delegate("a","click touchstart",function(e){e.preventDefault()})},setupManual:function(){a.controlNav=a.manualControls,m.controlNav.active(),a.controlNav.live(r,function(t){t.preventDefault(),t=e(this);var n=a.controlNav.index(t);t.hasClass(o+"active")||(a.direction=n>a.currentSlide?"next":"prev",a.flexAnimate(n,i.pauseOnAction))}),s&&a.controlNav.live("click touchstart",function(e){e.preventDefault()})},set:function(){a.controlNav=e("."+o+"control-nav li "+("thumbnails"===i.controlNav?"img":"a"),a.controlsContainer?a.controlsContainer:a)},active:function(){a.controlNav.removeClass(o+"active").eq(a.animatingTo).addClass(o+"active")},update:function(t,n){1<a.pagingCount&&"add"===t?a.controlNavScaffold.append(e("<li><a>"+a.count+"</a></li>")):1===a.pagingCount?a.controlNavScaffold.find("li").remove():a.controlNav.eq(n).closest("li").remove(),m.controlNav.set(),1<a.pagingCount&&a.pagingCount!==a.controlNav.length?a.update(n,t):m.controlNav.active()}},directionNav:{setup:function(){var t=e('<ul class="'+o+'direction-nav"><li><a class="'+o+'prev" href="#">'+i.prevText+'</a></li><li><a class="'+o+'next" href="#">'+i.nextText+"</a></li></ul>");a.controlsContainer?(e(a.controlsContainer).append(t),a.directionNav=e("."+o+"direction-nav li a",a.controlsContainer)):(a.append(t),a.directionNav=e("."+o+"direction-nav li a",a)),m.directionNav.update(
57),a.directionNav.bind(r,function(t){t.preventDefault(),t=a.getTarget(e(this).hasClass(o+"next")?"next":"prev"),a.flexAnimate(t,i.pauseOnAction)}),s&&a.directionNav.bind("click touchstart",function(e){e.preventDefault()})},update:function(){var e=o+"disabled";1===a.pagingCount?a.directionNav.addClass(e):i.animationLoop?a.directionNav.removeClass(e):0===a.animatingTo?a.directionNav.removeClass(e).filter("."+o+"prev").addClass(e):a.animatingTo===a.last?a.directionNav.removeClass(e).filter("."+o+"next").addClass(e):a.directionNav.removeClass(e)}},pausePlay:{setup:function(){var t=e('<div class="'+o+'pauseplay"><a></a></div>');a.controlsContainer?(a.controlsContainer.append(t),a.pausePlay=e("."+o+"pauseplay a",a.controlsContainer)):(a.append(t),a.pausePlay=e("."+o+"pauseplay a",a)),m.pausePlay.update(i.slideshow?o+"pause":o+"play"),a.pausePlay.bind(r,function(t){t.preventDefault(),e(this).hasClass(o+"pause")?(a.manualPause=!0,a.manualPlay=!1,a.pause()):(a.manualPause=!1,a.manualPlay=!0,a.play())}),s&&a.pausePlay.bind("click touchstart",function(e){e.preventDefault()})},update:function(e){"play"===e?a.pausePlay.removeClass(o+"pause").addClass(o+"play").text(i.playText):a.pausePlay.removeClass(o+"play").addClass(o+"pause").text(i.pauseText)}},touch:function(){function e(e){m=l?o-e.touches[0].pageY:o-e.touches[0].pageX,f=l?Math.abs(m)<Math.abs(e.touches[0].pageX-s):Math.abs(m)<Math.abs(e.touches[0].pageY-s),(!f||500<Number(new Date)-v)&&(e.preventDefault(),!u&&a.transitions&&(i.animationLoop||(m/=0===a.currentSlide&&0>m||a.currentSlide===a.last&&m>0?Math.abs(m)/p+2:1),a.setProps(r+m,"setTouch")))}function n(){if(t.removeEventListener("touchmove",e,!1),a.animatingTo===a.currentSlide&&!f&&null!==m){var l=c?-m:m,d=a.getTarget(l>0?"next":"prev");a.canAdvance(d)&&(550>Number(new Date)-v&&50<Math.abs(l)||Math.abs(l)>p/2)?a.flexAnimate(d,i.pauseOnAction):u||a.flexAnimate(a.currentSlide,i.pauseOnAction,!0)}t.removeEventListener("touchend",n,!1),r=m=s=o=null}var o,s,r,p,m,v,f=!1;t.addEventListener("touchstart",function(u){a.animating?u.preventDefault():1===u.touches.length&&(a.pause(),p=l?a.h:a.w,v=Number(new Date),r=d&&c&&a.animatingTo===a.last?0:d&&c?a.limit-(a.itemW+i.itemMargin)*a.move*a.animatingTo:d&&a.currentSlide===a.last?a.limit:d?(a.itemW+i.itemMargin)*a.move*a.currentSlide:c?(a.last-a.currentSlide+a.cloneOffset)*p:(a.currentSlide+a.cloneOffset)*p,o=l?u.touches[0].pageY:u.touches[0].pageX,s=l?u.touches[0].pageX:u.touches[0].pageY,t.addEventListener("touchmove",e,!1),t.addEventListener("touchend",n,!1))},!1)},resize:function(){!a.animating&&a.is(":visible")&&(d||a.doMath(),u?m.smoothHeight():d?(a.slides.width(a.computedW),a.update(a.pagingCount),a.setProps()):l?(a.viewport.height(a.h),a.setProps(a.h,"setTotal")):(i.smoothHeight&&m.smoothHeight(),a.newSlides.width(a.computedW),a.setProps(a.computedW,"setTotal")))},smoothHeight:function(e){if(!l||u){var t=u?a:a.viewport;e?t.animate({height:a.slides.eq(a.animatingTo).height()},e):t.height(a.slides.eq(a.animatingTo).height())}},sync:function(t){var n=e(i.sync).data("flexslider"),o=a.animatingTo;switch(t){case"animate":n.flexAnimate(o,i.pauseOnAction,!1,!0);break;case"play":!n.playing&&!n.asNav&&n.play();break;case"pause":n.pause()}}},a.flexAnimate=function(t,n,r,v,f){if(p&&1===a.pagingCount&&(a.direction=a.currentItem<t?"next":"prev"),!a.animating&&(a.canAdvance(t,f)||r)&&a.is(":visible")){if(p&&v){if(r=e(i.asNavFor).data("flexslider"),a.atEnd=0===t||t===a.count-1,r.flexAnimate(t,!0,!1,!0,f),a.direction=a.currentItem<t?"next":"prev",r.direction=a.direction,Math.ceil((t+1)/a.visible)-1===a.currentSlide||0===t)return a.currentItem=t,a.slides.removeClass(o+"active-slide").eq(t).addClass(o+"active-slide"),!1;a.currentItem=t,a.slides.removeClass(o+"active-slide").eq(t).addClass(o+"active-slide"),t=Math.floor(t/a.visible)}if(a.animating=!0,a.animatingTo=t,i.before(a),n&&a.pause(),a.syncExists&&!f&&m.sync("animate"),i.controlNav&&m.controlNav.active(),d||a.slides.removeClass(o+"active-slide").eq(t).addClass(o+"active-slide"),a.atEnd=0===t||t===a.last,i.directionNav&&m.directionNav.update(),t===a.last&&(i.end(a),i.animationLoop||a.pause()),u)s?(a.slides.eq(a.currentSlide).css({opacity:0,zIndex:1}),a.slides.eq(t).css({opacity:1,zIndex:2}),a.slides.unbind("webkitTransitionEnd transitionend"),a.slides.eq(a.currentSlide).bind("webkitTransitionEnd transitionend",function(){i.after(a)}),a.animating=!1,a.currentSlide=a.animatingTo):(a.slides.eq(a.currentSlide).fadeOut(i.animationSpeed,i.easing),a.slides.eq(t).fadeIn(i.animationSpeed,i.easing,a.wrapup));else{var g=l?a.slides.filter(":first").height():a.computedW;d?(t=i.itemWidth>a.w?2*i.itemMargin:i.itemMargin,t=(a.itemW+t)*a.move*a.animatingTo,t=t>a.limit&&1!==a.visible?a.limit:t):t=0===a.currentSlide&&t===a.count-1&&i.animationLoop&&"next"!==a.direction?c?(a.count+a.cloneOffset)*g:0:a.currentSlide===a.last&&0===t&&i.animationLoop&&"prev"!==a.direction?c?0:(a.c
57ount+1)*g:c?(a.count-1-t+a.cloneOffset)*g:(t+a.cloneOffset)*g,a.setProps(t,"",i.animationSpeed),a.transitions?(i.animationLoop&&a.atEnd||(a.animating=!1,a.currentSlide=a.animatingTo),a.container.unbind("webkitTransitionEnd transitionend"),a.container.bind("webkitTransitionEnd transitionend",function(){a.wrapup(g)})):a.container.animate(a.args,i.animationSpeed,i.easing,function(){a.wrapup(g)})}i.smoothHeight&&m.smoothHeight(i.animationSpeed)}},a.wrapup=function(e){!u&&!d&&(0===a.currentSlide&&a.animatingTo===a.last&&i.animationLoop?a.setProps(e,"jumpEnd"):a.currentSlide===a.last&&0===a.animatingTo&&i.animationLoop&&a.setProps(e,"jumpStart")),a.animating=!1,a.currentSlide=a.animatingTo,i.after(a)},a.animateSlides=function(){a.animating||a.flexAnimate(a.getTarget("next"))},a.pause=function(){clearInterval(a.animatedSlides),a.playing=!1,i.pausePlay&&m.pausePlay.update("play"),a.syncExists&&m.sync("pause")},a.play=function(){a.animatedSlides=setInterval(a.animateSlides,i.slideshowSpeed),a.playing=!0,i.pausePlay&&m.pausePlay.update("pause"),a.syncExists&&m.sync("play")},a.canAdvance=function(e,t){var n=p?a.pagingCount-1:a.last;return t?!0:p&&a.currentItem===a.count-1&&0===e&&"prev"===a.direction?!0:p&&0===a.currentItem&&e===a.pagingCount-1&&"next"!==a.direction?!1:e!==a.currentSlide||p?i.animationLoop?!0:a.atEnd&&0===a.currentSlide&&e===n&&"next"!==a.direction?!1:a.atEnd&&a.currentSlide===n&&0===e&&"next"===a.direction?!1:!0:!1},a.getTarget=function(e){return a.direction=e,"next"===e?a.currentSlide===a.last?0:a.currentSlide+1:0===a.currentSlide?a.last:a.currentSlide-1},a.setProps=function(e,t,n){var o,s=e?e:(a.itemW+i.itemMargin)*a.move*a.animatingTo;o=-1*function(){if(d)return"setTouch"===t?e:c&&a.animatingTo===a.last?0:c?a.limit-(a.itemW+i.itemMargin)*a.move*a.animatingTo:a.animatingTo===a.last?a.limit:s;switch(t){case"setTotal":return c?(a.count-1-a.currentSlide+a.cloneOffset)*e:(a.currentSlide+a.cloneOffset)*e;case"setTouch":return e;case"jumpEnd":return c?e:a.count*e;case"jumpStart":return c?a.count*e:e;default:return e}}()+"px",a.transitions&&(o=l?"translate3d(0,"+o+",0)":"translate3d("+o+",0,0)",n=void 0!==n?n/1e3+"s":"0s",a.container.css("-"+a.pfx+"-transition-duration",n)),a.args[a.prop]=o,(a.transitions||void 0===n)&&a.container.css(a.args)},a.setup=function(t){if(u)a.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===t&&(s?a.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+i.animationSpeed/1e3+"s ease",zIndex:1}).eq(a.currentSlide).css({opacity:1,zIndex:2}):a.slides.eq(a.currentSlide).fadeIn(i.animationSpeed,i.easing)),i.smoothHeight&&m.smoothHeight();else{var n,r;"init"===t&&(a.viewport=e('<div class="'+o+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(a).append(a.container),a.cloneCount=0,a.cloneOffset=0,c&&(r=e.makeArray(a.slides).reverse(),a.slides=e(r),a.container.empty().append(a.slides))),i.animationLoop&&!d&&(a.cloneCount=2,a.cloneOffset=1,"init"!==t&&a.container.find(".clone").remove(),a.container.append(a.slides.first().clone().addClass("clone")).prepend(a.slides.last().clone().addClass("clone"))),a.newSlides=e(i.selector,a),n=c?a.count-1-a.currentSlide+a.cloneOffset:a.currentSlide+a.cloneOffset,l&&!d?(a.container.height(200*(a.count+a.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){a.newSlides.css({display:"block"}),a.doMath(),a.viewport.height(a.h),a.setProps(n*a.h,"init")},"init"===t?100:0)):(a.container.width(200*(a.count+a.cloneCount)+"%"),a.setProps(n*a.computedW,"init"),setTimeout(function(){a.doMath(),a.newSlides.css({width:a.computedW,"float":"left",display:"block"}),i.smoothHeight&&m.smoothHeight()},"init"===t?100:0))}d||a.slides.removeClass(o+"active-slide").eq(a.currentSlide).addClass(o+"active-slide")},a.doMath=function(){var e=a.slides.first(),t=i.itemMargin,n=i.minItems,o=i.maxItems;a.w=a.width(),a.h=e.height(),a.boxPadding=e.outerWidth()-e.width(),d?(a.itemT=i.itemWidth+t,a.minW=n?n*a.itemT:a.w,a.maxW=o?o*a.itemT:a.w,a.itemW=a.minW>a.w?(a.w-t*n)/n:a.maxW<a.w?(a.w-t*o)/o:i.itemWidth>a.w?a.w:i.itemWidth,a.visible=Math.floor(a.w/(a.itemW+t)),a.move=0<i.move&&i.move<a.visible?i.move:a.visible,a.pagingCount=Math.ceil((a.count-a.visible)/a.move+1),a.last=a.pagingCount-1,a.limit=1===a.pagingCount?0:i.itemWidth>a.w?(a.itemW+2*t)*a.count-a.w-t:(a.itemW+t)*a.count-a.w-t):(a.itemW=a.w,a.pagingCount=a.count,a.last=a.count-1),a.computedW=a.itemW-a.boxPadding},a.update=function(e,t){a.doMath(),d||(e<a.currentSlide?a.currentSlide+=1:e<=a.currentSlide&&0!==e&&(a.currentSlide-=1),a.animatingTo=a.currentSlide),i.c
57ontrolNav&&!a.manualControls&&("add"===t&&!d||a.pagingCount>a.controlNav.length?m.controlNav.update("add"):("remove"===t&&!d||a.pagingCount<a.controlNav.length)&&(d&&a.currentSlide>a.last&&(a.currentSlide-=1,a.animatingTo-=1),m.controlNav.update("remove",a.last))),i.directionNav&&m.directionNav.update()},a.addSlide=function(t,n){var o=e(t);a.count+=1,a.last=a.count-1,l&&c?void 0!==n?a.slides.eq(a.count-n).after(o):a.container.prepend(o):void 0!==n?a.slides.eq(n).before(o):a.container.append(o),a.update(n,"add"),a.slides=e(i.selector+":not(.clone)",a),a.setup(),i.added(a)},a.removeSlide=function(t){var n=isNaN(t)?a.slides.index(e(t)):t;a.count-=1,a.last=a.count-1,isNaN(t)?e(t,a.slides).remove():l&&c?a.slides.eq(a.last).remove():a.slides.eq(t).remove(),a.doMath(),a.update(n,"remove"),a.slides=e(i.selector+":not(.clone)",a),a.setup(),i.removed(a)},m.init()},e.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:!1,pauseOnAction:!0,pauseOnHover:!1,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:0,maxItems:0,move:0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}},e.fn.flexslider=function(t){if(void 0===t&&(t={}),"object"==typeof t)return this.each(function(){var n=e(this),a=n.find(t.selector?t.selector:".slides > li");1===a.length?(a.fadeIn(400),t.start&&t.start(n)):void 0==n.data("flexslider")&&new e.flexslider(this,t)});var n=e(this).data("flexslider");switch(t){case"play":n.play();break;case"pause":n.pause();break;case"next":n.flexAnimate(n.getTarget("next"),!0);break;case"prev":case"previous":n.flexAnimate(n.getTarget("prev"),!0);break;default:"number"==typeof t&&n.flexAnimate(t,!0)}}}(jQuery); 58 59 60 61jQuery(document).ready(function($){ 62 63 64/***************** Pretty Photo ******************/ 65 66 function prettyPhotoInit(){ 67 68 //add galleries to portfolios 69 $('.portfolio-items').each(function(){ 70 var $unique_id = Math.floor(Math.random()*10000); 71 $(this).find('.pretty_photo').attr('rel','prettyPhoto['+$unique_id+'_gal]').removeClass('pretty_photo'); 72 }); 73 74 $("a[data-rel='prettyPhoto[product-gallery]'], a[data-rel='prettyPhoto']").each(function(){ 75 $(this).attr('rel',$(this).attr('data-rel')); 76 $(this).removeAttr('data-rel'); 77 }); 78 79 //nectar auto lightbox 80 if($('body').hasClass('nectar-auto-lightbox')){ 81 $('.gallery').each(function(){ 82 if($(this).find('.gallery-icon a[rel^="prettyPhoto"]').length == 0) { 83 var $unique_id = Math.floor(Math.random()*10000); 84 $(this).find('.gallery-item .gallery-icon a[href*=".jpg"], .gallery-item .gallery-icon a[href*=".png"], .gallery-item .gallery-icon a[href*=".gif"], .gallery-item .gallery-icon a[href*=".jpeg"]').attr('rel','prettyPhoto['+$unique_id+'_gal]').removeClass('pretty_photo'); 85 } 86 }); 87 $('.main-content img').each(function(){ 88 if($(this).parent().is("[href]") && !$(this).parent().is("[rel*='prettyPhoto']") && $(this).parents('.product-image').length == 0 && $(this).parents('.iosSlider.product-slider').length == 0) { 89 var match = $(this).parent().attr('href').match(/\.(jpg|png|gif)\b/); 90 if(match) $(this).parent().attr('rel','prettyPhoto'); 91 } 92 }); 93 } 94 95 96 //convert class usage into rel 97 $('a.pp').removeClass('pp').attr('rel','prettyPhoto'); 98 99 var loading_animation = ($('body[data-loading-animation]').attr('data-loading-animation') != 'none') ? $('body').attr('data-loading-animation') : null ; 100 var ascend_loader = ($('body').hasClass('ascend')) ? '<span class="default-loading-icon spin"></span>' :''; 101 var ascend_loader_class = ($('body').hasClass('ascend')) ? 'default_loader ' : ''; 102 $("a[rel^='prettyPhoto']").prettyPhoto({ 103 theme: 'dark_rounded', 104 allow_resize: true, 105 default_width: 1024, 106 opacity: 0.85, 107 animation_speed: 'normal', 108 deeplinking: false, 109 default_height: 576, 110 social_tools: '', 111 markup: '<div class="pp_pic_holder"> \ 112 <div class="ppt"> </div> \ 113 <div class="pp_details"> \ 114 <div class="pp_nav"> \ 115 <a href="#" class="pp_arrow_previous"> <i class="icon-salient-left-arrow-thin icon-default-style"></i> </a> \ 116 <a href="#" class="pp_arrow_next"> <i class="icon-salient-right-arrow-thin icon-default-style"></i> </a> \ 117 <p class="currentTextHolder">0/0</p> \ 118 </div> \ 119 <a class="pp_close" href="#"><span class="icon-salient-x icon-default-style"></span></a> \ 120 </div> \ 121 <div class="pp_content_container"> \ 122 <div class="pp_left"> \ 123 <div class="pp_right"> \ 124 <div class="pp_content"> \ 125 <div class="pp_fade"> \ 126 <div class="pp_hoverContainer"> \ 127 </div> \ 128 <div id="pp_full_res"></div> \ 129 <p class="pp_description"></p> \ 130 </div> \ 131 </div> \ 132 </div> \ 133 </div> \ 134 </div> \ 135 </div> \ 136 <div class="pp_loaderIcon ' + ascend_loader_class + loading_animation+'"> '+ascend_loader+' </div> \ 137 <div class="pp_overlay"></div>' 138 }); 139 140 } 141 142 143 function magnificInit() { 144 145 //convert old pp links 146 $('a.pp').removeClass('pp').addClass('magnific-popup'); 147 $("a[rel^='prettyPhoto']:not([rel*='_gal']):not([rel*='product-gallery']):not([rel*='prettyPhoto['])").removeAttr('rel').addClass('magnific-popup'); 148 149 150 //add galleries to portfolios 151 $('.portfolio-items').each(function(){ 152 if($(this).find('.pretty_photo').length > 0) { 153 $(this).find('.pretty_photo').removeClass('pretty_photo').addClass('gallery').addClass('magnific'); 154 } else if($(this).find('a[rel*="prettyPhoto["]').length > 0){ 155 $(this).find('a[rel*="prettyPhoto["]').removeAttr('rel').addClass('gallery').addClass('magnific'); 156 } 157 158 }); 159 160 $("a[data-rel='prettyPhoto[product-gallery]']").each(function(){ 161 $(this).removeAttr('data-rel').addClass('magnific').addClass('gallery'); 162 }); 163 164 //nectar auto lightbox 165 if($('body').hasClass('nectar-auto-lightbox')){ 166 $('.gallery').each(function(){ 167 if($(this).find('.gallery-icon a[rel^="prettyPhoto"]').length == 0) { 168 var $unique_id = Math.floor(Math.random()*10000); 169 $(this).find('.gallery-item .gallery-icon a[href*=".jpg"], .gallery-item .gallery-icon a[href*=".png"], .gallery-item .gallery-icon a[href*=".gif"], .gallery-item .gallery-icon a[href*=".jpeg"]').addClass('magnific').addClass('gallery').removeClass('pretty_photo'); 170 } 171 }); 172 $('.main-content img').each(function(){ 173 if($(this).parent().is("[href]") && !$(this).parent().is(".magnific-popup") && $(this).parents('.product-image').length == 0 && $(this).parents('.iosSlider.product-slider').length == 0) { 174 var match = $(this).parent().attr('href').match(/\.(jpg|png|gif)\b/); 175 if(match) $(this).parent().addClass('magnific-popup').addClass('image-link'); 176 } 177 }); 178 } 179 180 181 //regular 182 $('a.magnific-popup:not(.gallery):not(.nectar_video_lightbox)').magnificPopup({ 183 type: 'image', 184 callbacks: { 185 186 imageLoadComplete: function() { 187 var $that = this; 188 setTimeout( function() { $that.wrap.addClass('mfp-image-loaded'); }, 10); 189 }, 190 beforeOpen: function() { 191 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 192 }, 193 open: function() { 194 195 $.magnificPopup.instance.next = function() { 196 var $that = this; 197 198 this.wrap.removeClass('mfp-image-loaded'); 199 setTimeout( function() { $.magnificPopup.proto.next.call($that); }, 100); 200 } 201 202 $.magnificPopup.instance.prev = function() { 203 var $that = this; 204 205 this.wrap.removeClass('mfp-image-loaded'); 206 setTimeout( function() { $.magnificPopup.proto.prev.call($that); }, 100); 207 } 208 209 } 210 },
211 fixedContentPos: false, 212 mainClass: 'mfp-zoom-in', 213 removalDelay: 400 214 }); 215 216 //video 217 $('a.magnific-popup.nectar_video_lightbox, .swiper-slide a[href*=youtube], .swiper-slide a[href*=vimeo]').magnificPopup({ 218 type: 'iframe', 219 fixedContentPos: false, 220 mainClass: 'mfp-zoom-in', 221 removalDelay: 400 222 }); 223 224 225 //galleries 226 $('a.magnific.gallery').each(function(){ 227 228 var $parentRow = ($(this).parents('.wpb_row').length > 0) ? $(this).parents('.wpb_row') : $(this).parents('.row'); 229 if($parentRow.length > 0 && !$parentRow.hasClass('lightbox-row')) { 230 231 $parentRow.magnificPopup({ 232 type: 'image', 233 delegate: 'a.magnific', 234 mainClass: 'mfp-zoom-in', 235 fixedContentPos: false, 236 callbacks: { 237 238 elementParse: function(item) { 239 240 if($(item.el.context).is('[href]') && $(item.el.context).attr('href').indexOf('iframe=true') != -1) { 241 item.type = 'iframe'; 242 } else { 243 item.type = 'image'; 244 } 245 }, 246 247 imageLoadComplete: function() { 248 var $that = this; 249 setTimeout( function() { $that.wrap.addClass('mfp-image-loaded'); }, 10); 250 }, 251 252 beforeOpen: function() { 253 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 254 }, 255 256 open: function() { 257 258 $.magnificPopup.instance.next = function() { 259 var $that = this; 260 261 this.wrap.removeClass('mfp-image-loaded'); 262 setTimeout( function() { $.magnificPopup.proto.next.call($that); }, 100); 263 } 264 265 $.magnificPopup.instance.prev = function() { 266 var $that = this; 267 268 this.wrap.removeClass('mfp-image-loaded'); 269 setTimeout( function() { $.magnificPopup.proto.prev.call($that); }, 100); 270 } 271 272 } 273 }, 274 removalDelay: 400, 275 gallery: { 276 enabled:true 277 } 278 }); 279 280 $parentRow.addClass('lightbox-row'); 281 } 282 283 }); 284 285 } 286 287 function lightBoxInit() { 288 if($('body[data-ls="pretty_photo"]').length > 0) { 289 prettyPhotoInit(); 290 } else if($('body[data-ls="magnific"]').length > 0) { 291 magnificInit(); 292 } 293 } 294 295 lightBoxInit(); 296 //check for late links 297 setTimeout(lightBoxInit,500); 298 299/*! 300 * jQuery Transit - CSS3 transitions and transformations 301 * (c) 2011-2012 Rico Sta. Cruz <[email protected]> 302 * MIT Licensed. 303 * 304 * http://ricostacruz.com/jquery.transit 305 * http://github.com/rstacruz/jquery.transit 306 */ 307(function(k){k.transit={version:"0.9.9",propertyMap:{marginLeft:"margin",marginRight:"margin",marginBottom:"margin",marginTop:"margin",paddingLeft:"padding",paddingRight:"padding",paddingBottom:"padding",paddingTop:"padding"},enabled:true,useTransitionEnd:false};var d=document.createElement("div");var q={};function b(v){if(v in d.style){return v}var u=["Moz","Webkit","O","ms"];var r=v.charAt(0).toUpperCase()+v.substr(1);if(v in d.style){return v}for(var t=0;t<u.length;++t){var s=u[t]+r;if(s in d.style){return s}}}function e(){d.style[q.transform]="";d.style[q.transform]="rotateY(90deg)";return d.style[q.transform]!==""}var a=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;q.transition=b("transition");q.transitionDelay=b("transitionDelay");q.transform=b("transform");q.transformOrigin=b("transformOrigin");q.transform3d=e();var i={transition:"transitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",msTransition:"MSTransitionEnd"};var f=q.transitionEnd=i[q.transition]||null;for(var p in q){if(q.hasOwnProperty(p)&&typeof k.support[p]==="undefined"){k.support[p]=q[p]}}d=null;k.cssEase={_default:"ease","in":"ease-in",out:"ease-out","in-out":"ease-in-out",snap:"cubic-bezier(0,1,.5,1)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1
307)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)"};k.cssHooks["transit:transform"]={get:function(r){return k(r).data("transform")||new j()},set:function(s,r){var t=r;if(!(t instanceof j)){t=new j(t)}if(q.transform==="WebkitTransform"&&!a){s.style[q.transform]=t.toString(true)}else{s.style[q.transform]=t.toString()}k(s).data("transform",t)}};k.cssHooks.transform={set:k.cssHooks["transit:transform"].set};if(k.fn.jquery<"1.8"){k.cssHooks.transformOrigin={get:function(r){return r.style[q.transformOrigin]},set:function(r,s){r.style[q.transformOrigin]=s}};k.cssHooks.transition={get:function(r){return r.style[q.transition]},set:function(r,s){r.style[q.transition]=s}}}n("scale");n("translate");n("rotate");n("rotateX");n("rotateY");n("rotate3d");n("perspective");n("skewX");n("skewY");n("x",true);n("y",true);function j(r){if(typeof r==="string"){this.parse(r)}return this}j.prototype={setFromString:function(t,s){var r=(typeof s==="string")?s.split(","):(s.constructor===Array)?s:[s];r.unshift(t);j.prototype.set.apply(this,r)},set:function(s){var r=Array.prototype.slice.apply(arguments,[1]);if(this.setter[s]){this.setter[s].apply(this,r)}else{this[s]=r.join(",")}},get:function(r){if(this.getter[r]){return this.getter[r].apply(this)}else{return this[r]||0}},setter:{rotate:function(r){this.rotate=o(r,"deg")},rotateX:function(r){this.rotateX=o(r,"deg")},rotateY:function(r){this.rotateY=o(r,"deg")},scale:function(r,s){if(s===undefined){s=r}this.scale=r+","+s},skewX:function(r){this.skewX=o(r,"deg")},skewY:function(r){this.skewY=o(r,"deg")},perspective:function(r){this.perspective=o(r,"px")},x:function(r){this.set("translate",r,null)},y:function(r){this.set("translate",null,r)},translate:function(r,s){if(this._translateX===undefined){this._translateX=0}if(this._translateY===undefined){this._translateY=0}if(r!==null&&r!==undefined){this._translateX=o(r,"px")}if(s!==null&&s!==undefined){this._translateY=o(s,"px")}
307this.translate=this._translateX+","+this._translateY}},getter:{x:function(){return this._translateX||0},y:function(){return this._translateY||0},scale:function(){var r=(this.scale||"1,1").split(",");if(r[0]){r[0]=parseFloat(r[0])}if(r[1]){r[1]=parseFloat(r[1])}return(r[0]===r[1])?r[0]:r},rotate3d:function(){var t=(this.rotate3d||"0,0,0,0deg").split(",");for(var r=0;r<=3;++r){if(t[r]){t[r]=parseFloat(t[r])}}if(t[3]){t[3]=o(t[3],"deg")}return t}},parse:function(s){var r=this;s.replace(/([a-zA-Z0-9]+)\((.*?)\)/g,function(t,v,u){r.setFromString(v,u)})},toString:function(t){var s=[];for(var r in this){if(this.hasOwnProperty(r)){if((!q.transform3d)&&((r==="rotateX")||(r==="rotateY")||(r==="perspective")||(r==="transformOrigin"))){continue}if(r[0]!=="_"){if(t&&(r==="scale")){s.push(r+"3d("+this[r]+",1)")}else{if(t&&(r==="translate")){s.push(r+"3d("+this[r]+",0)")}else{s.push(r+"("+this[r]+")")}}}}}return s.join(" ")}};function m(s,r,t){if(r===true){s.queue(t)}else{if(r){s.queue(r,t)}else{t()}}}function h(s){var r=[];k.each(s,function(t){t=k.camelCase(t);t=k.transit.propertyMap[t]||k.cssProps[t]||t;t=c(t);if(k.inArray(t,r)===-1){r.push(t)}});return r}function g(s,v,x,r){var t=h(s);if(k.cssEase[x]){x=k.cssEase[x]}var w=""+l(v)+" "+x;if(parseInt(r,10)>0){w+=" "+l(r)}var u=[];k.each(t,function(z,y){u.push(y+" "+w)});return u.join(", ")}k.fn.transition=k.fn.transit=function(z,s,y,C){var D=this;var u=0;var w=true;if(typeof s==="function"){C=s;s=undefined}if(typeof y==="function"){C=y;y=undefined}if(typeof z.easing!=="undefined"){y=z.easing;delete z.easing}if(typeof z.duration!=="undefined"){s=z.duration;delete z.duration}if(typeof z.complete!=="undefined"){C=z.complete;delete z.complete}if(typeof z.queue!=="undefined"){w=z.queue;delete z.queue}if(typeof z.delay!=="undefined"){u=z.delay;delete z.delay}if(typeof s==="undefined"){s=k.fx.speeds._default}if(typeof y==="undefined"){y=k.cssEase._default}s=l(s);var E=g(z,s,y,u);var B=k.transit.enabled&&q.transition;var t=B?(parseInt(s,10)+parseInt(u,10)):0;if(t===0){var A=function(F){D.css(z);if(C){C.apply(D)}if(F){F()}};m(D,w,A);return D}var x={};var r=function(H){var G=false;var F=function(){if(G){D.unbind(f,F)}if(t>0){D.each(function(){this.style[q.transition]=(x[this]||null)})}if(typeof C==="function"){C.apply(D)}if(typeof H==="function"){H()}};if((t>0)&&(f)&&(k.transit.useTransitionEnd)){G=true;D.bind(f,F)}else{window.setTimeout(F,t)}D.each(function(){if(t>0){this.style[q.transition]=E}k(this).css(z)})};var v=function(F){this.offsetWidth;r(F)};m(D,w,v);return this};function n(s,r){if(!r){k.cssNumber[s]=true}k.transit.propertyMap[s]=q.transform;k.cssHooks[s]={get:function(v){var u=k(v).css("transit:transform");return u.get(s)},set:function(v,w){var u=k(v).css("transit:transform");u.setFromString(s,w);k(v).css({"transit:transform":u})}}}function c(r){return r.replace(/([A-Z])/g,function(s){return"-"+s.toLowerCase()})}function o(s,r){if((typeof s==="string")&&(!s.match(/^[\-0-9\.]+$/))){return s}else{return""+s+r}}function l(s){var r=s;if(k.fx.speeds[r]){r=k.fx.speeds[r]}return o(r,"ms")}k.transit.getTransitionValue=g})(jQuery); 308 309 310 311 312 // ========================= smartresize =============================== 313 314 /* 315 * smartresize: debounced resize event for jQuery 316 * 317 * latest version and complete README available on Github: 318 * https://github.com/louisremi/jquery.smartresize.js 319 * 320 * Copyright 2011 @louis_remi 321 * Licensed under the MIT license. 322 */ 323 324 var $event = $.event, 325 dispatchMethod = $.event.handle ? 'handle' : 'dispatch', 326 resizeTimeout; 327 328 $event.special.smartresize = { 329 setup: function() { 330 $(this).bind( "resize", $event.special.smartresize.handler ); 331 }, 332 teardown: function() { 333 $(this).unbind( "resize", $event.special.smartresize.handler ); 334 }, 335 handler: function( event, execAsap ) { 336 // Save the context 337 var context = this, 338 args = arguments; 339 340 // set correct event type 341 event.type = "smartresize"; 342 343 if ( resizeTimeout ) { clearTimeout( resizeTimeout ); } 344 resizeTimeout = setTimeout(function() { 345 $event[ dispatchMethod ].apply( context, args ); 346 }, execAsap === "execAsap"? 0 : 100 ); 347 } 348 }; 349 350 $.fn.smartresize = function( fn ) { 351 return fn ? this.bind( "smartresize", fn ) : this.trigger( "smartresize", ["execAsap"] ); 352 }; 353 354 355 356/***************** Smooth Scrolling ******************/ 357 358 function niceScrollInit(){ 359 $("html").niceScroll({ 360 scrollspeed: 60, 361 mousescrollstep: 40, 362 cursorwidth: 15, 363 cursorborder: 0, 364 cursorcolor: '#303030',
365 cursorborderradius: 6, 366 autohidemode: false, 367 horizrailenabled: false 368 }); 369 370 371 if($('#boxed').length == 0){ 372 $('body, body #header-outer, body #header-secondary-outer, body #search-outer').css('padding-right','16px'); 373 } else if($('body[data-ext-responsive="true"]').length == 0 ) { 374 $('body').css('padding-right','16px'); 375 } 376 377 $('html').addClass('no-overflow-y'); 378 } 379 380 var $smoothActive = $('body').attr('data-smooth-scrolling'); 381 var $smoothCache = ( $smoothActive == 1 ) ? true : false; 382 383 if( $smoothActive == 1 && $(window).width() > 690 && $('body').outerHeight(true) > $(window).height() && Modernizr.csstransforms3d && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ niceScrollInit(); } else { 384 $('body').attr('data-smooth-scrolling','0'); 385 } 386 387 //chrome ss 388 if($smoothCache == false && navigator.platform.toUpperCase().indexOf('MAC') === -1 && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/) && $(window).width() > 690) { 389 !function(){function e(){var e=!1;e&&c("keydown",r),v.keyboardSupport&&!e&&u("keydown",r)}function t(){if(document.body){var t=document.body,n=document.documentElement,o=window.innerHeight,r=t.scrollHeight;if(S=document.compatMode.indexOf("CSS")>=0?n:t,w=t,e(),x=!0,top!=self)y=!0;else if(r>o&&(t.offsetHeight<=o||n.offsetHeight<=o)){var a=!1,i=function(){a||n.scrollHeight==document.height||(a=!0,setTimeout(function(){n.style.height=document.height+"px",a=!1},500))};if(n.style.height="auto",setTimeout(i,10),S.offsetHeight<=o){var l=document.createElement("div");l.style.clear="both",t.appendChild(l)}}v.fixedBackground||b||(t.style.backgroundAttachment="scroll",n.style.backgroundAttachment="scroll")}}function n(e,t,n,o){if(o||(o=1e3),d(t,n),1!=v.accelerationMax){var r=+new Date,a=r-C;if(a<v.accelerationDelta){var i=(1+30/a)/2;i>1&&(i=Math.min(i,v.accelerationMax),t*=i,n*=i)}C=+new Date}if(M.push({x:t,y:n,lastX:0>t?.99:-.99,lastY:0>n?.99:-.99,start:+new Date}),!T){var l=e===document.body,u=function(){for(var r=+new Date,a=0,i=0,c=0;c<M.length;c++){var s=M[c],d=r-s.start,f=d>=v.animationTime,h=f?1:d/v.animationTime;v.pulseAlgorithm&&(h=p(h));var m=s.x*h-s.lastX>>0,w=s.y*h-s.lastY>>0;a+=m,i+=w,s.lastX+=m,s.lastY+=w,f&&(M.splice(c,1),c--)}l?window.scrollBy(a,i):(a&&(e.scrollLeft+=a),i&&(e.scrollTop+=i)),t||n||(M=[]),M.length?N(u,e,o/v.frameRate+1):T=!1};N(u,e,0),T=!0}}function o(e){x||t();var o=e.target,r=l(o);if(!r||e.defaultPrevented||s(w,"embed")||s(o,"embed")&&/\.pdf/i.test(o.src))return!0;var a=e.wheelDeltaX||0,i=e.wheelDeltaY||0;return a||i||(i=e.wheelDelta||0),!v.touchpadSupport&&f(i)?!0:(Math.abs(a)>1.2&&(a*=v.stepSize/120),Math.abs(i)>1.2&&(i*=v.stepSize/120),n(r,-a,-i),void e.preventDefault())}function r(e){var t=e.target,o=e.ctrlKey||e.altKey||e.metaKey||e.shiftKey&&e.keyCode!==H.spacebar;if(/input|textarea|select|embed/i.test(t.nodeName)||t.isContentEditable||e.defaultPrevented||o)return!0;if(s(t,"button")&&e.keyCode===H.spacebar)return!0;var r,a=0,i=0,u=l(w),c=u.clientHeight;switch(u==document.body&&(c=window.innerHeight),e.keyCode){case H.up:i=-v.arrowScroll;break;case H.down:i=v.arrowScroll;break;case H.spacebar:r=e.shiftKey?1:-1,i=-r*c*.9;break;case H.pageup:i=.9*-c;break;case H.pagedown:i=.9*c;break;case H.home:i=-u.scrollTop;break;case H.end:var d=u.scrollHeight-u.scrollTop-c;i=d>0?d+10:0;break;case H.left:a=-v.arrowScroll;break;case H.right:a=v.arrowScroll;break;default:return!0}n(u,a,i),e.preventDefault()}function a(e){w=e.target}function i(e,t){for(var n=e.length;n--;)E[A(e[n])]=t;return t}function l(e){var t=[],n=S.scrollHeight;do{var o=E[A(e)];if(o)return i(t,o);if(t.push(e),n===e.scrollHeight){if(!y||S.clientHeight+10<n)return i(t,document.body)}else if(e.clientHeight+10<e.scrollHeight&&(overflow=getComputedStyle(e,"").getPropertyValue("overflow-y"),"scroll"===overflow||"auto"===overflow))return i(t,e)}while(e=e.parentNode)}function u(e,t,n){window.addEventListener(e,t,n||!1)}function c(e,t,n){window.removeEventListener(e,t,n||!1)}function s(e,t){return(e.nodeName||"").toLowerCase()===t.toLowerCase()}function d(e,t){e=e>0?1:-1,t=t>0?1:-1,(k.x!==e||k.y!==t)&&(k.x=e,k.y=t,M=[],C=0)}function f(e){if(e){e=Math.abs(e),D.push(e),D.shift(),clearTimeout(z);
389var t=h(D[0],120)&&h(D[1],120)&&h(D[2],120);return!t}}function h(e,t){return Math.floor(e/t)==e/t}function m(e){var t,n,o;return e*=v.pulseScale,1>e?t=e-(1-Math.exp(-e)):(n=Math.exp(-1),e-=1,o=1-Math.exp(-e),t=n+o*(1-n)),t*v.pulseNormalize}function p(e){return e>=1?1:0>=e?0:(1==v.pulseNormalize&&(v.pulseNormalize/=m(1)),m(e))}var w,g={frameRate:150,animationTime:500,stepSize:120,pulseAlgorithm:!0,pulseScale:8,pulseNormalize:1,accelerationDelta:20,accelerationMax:1,keyboardSupport:!0,arrowScroll:50,touchpadSupport:!0,fixedBackground:!0,excluded:""},v=g,b=!1,y=!1,k={x:0,y:0},x=!1,S=document.documentElement,D=[120,120,120],H={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36},v=g,M=[],T=!1,C=+new Date,E={};setInterval(function(){E={}},1e4);var z,A=function(){var e=0;return function(t){return t.uniqueID||(t.uniqueID=e++)}}(),N=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(e,t,n){window.setTimeout(e,n||1e3/60)}}(),K=/chrome/i.test(window.navigator.userAgent),L=null;"onwheel"in document.createElement("div")?L="wheel":"onmousewheel"in document.createElement("div")&&(L="mousewheel"),L&&K&&(u(L,o),u("mousedown",a),u("load",t))}(); 390 } 391 392 393 394 395 396 397 398/***************** Sliders ******************/ 399 400 //gallery 401 function flexsliderInit(){ 402 $('.flex-gallery').each(function(){ 403 404 var $that = $(this); 405 406 imagesLoaded($(this),function(instance){ 407 408 $that.flexslider({ 409 animation: 'fade', 410 smoothHeight: false, 411 animationSpeed: 500, 412 useCSS: false, 413 touch: true 414 }); 415 416 ////gallery slider add arrows 417 $('.flex-gallery .flex-direction-nav li a.flex-next').html('<i class="icon-angle-right"></i>'); 418 $('.flex-gallery .flex-direction-nav li a.flex-prev').html('<i class="icon-angle-left"></i>'); 419 420 }); 421 422 }); 423 } 424 flexsliderInit(); 425 426 427 function flickityInit() { 428 if($('.nectar-flickity:not(.masonry)').length == 0) return false; 429 430 $('.nectar-flickity:not(.masonry)').flickity({ 431 contain: true, 432 draggable: true, 433 lazyLoad: false, 434 imagesLoaded: true, 435 percentPosition: true, 436 prevNextButtons: false, 437 pageDots: true, 438 resize: true, 439 setGallerySize: true, 440 wrapAround: true, 441 accessibility: false 442 }); 443 444 } 445 setTimeout(flickityInit,100); 446 447 function flickityBlogInit() { 448 if($('.nectar-flickity.masonry.not-initialized').length == 0) return false; 449 450 $('.nectar-flickity.masonry.not-initialized').each(function(){ 451 452 //move pos for large_featured 453 if($(this).parents('article').hasClass('large_featured')) 454 $(this).insertBefore( $(this).parents('article').find('.content-inner') ); 455 456 }); 457 458 459 $('.nectar-flickity.masonry.not-initialized').flickity({ 460 contain: true, 461 draggable: false, 462 lazyLoad: false, 463 imagesLoaded: true, 464 percentPosition: true, 465 prevNextButtons: true, 466 pageDots: false, 467 resize: true, 468 setGallerySize: true, 469 wrapAround: true, 470 accessibility: false 471 472 }); 473 474 $('.nectar-flickity.masonry').removeClass('not-initialized'); 475 476 //add count 477 $('.nectar-flickity.masonry:not(.not-initialized)').each(function(){ 478 if($(this).find('.item-count').length == 0) { 479 $('<div class="item-count"/>').insertBefore($(this).find('.flickity-prev-next-button.next')); 480 $(this).find('.item-count').html('<span class="current">1</span>/<span class="total">' + $(this).find('.flickity-slider .cell').length + '</span>'); 481 482 $(this).find('.flickity-prev-next-button, .item-count').wrapAll('<div class="control-wrap" />'); 483 484 //move pos for wide_tall 485 if($(this).parents('article').hasClass('wide_tall')) 486 $(this).find('.control-wrap').insertBefore( $(this) ); 487 } 488 }); 489 490 //update count 491 $('.masonry .flickity-prev-next-button.previous, .masonry .flickity-prev-next-button.next').click(function(){ 492 if($(this).parents('.wide_tall').length > 0) 493 $(this).parent().find('.item-count .current').html($(this).parents('article').find('.nectar-flickity .cell.is-selected').index()+1); 494 else 495 $(this).parent().find('.item-count .current').html($(this).parents('.nectar-flickity').find('.cell.is-selected').index()+1); 496 }); 497 498 $('body').on('mouseover','.flickity-prev-next-button.next',function(){ 499 $(this).parent().find('.flickity-prev-next-button.previous, .item-count').addClass('next-hovered'); 500 }); 501 $('body').on('mouseleave','.flickity-prev-next-button.next',function(){ 502 $(this).parent().find('.flickity-prev-next-button.previous, .item-count').removeClass('next-hovered'); 503 }); 504 505 } 506/****************twenty twenty******************/ 507 $('.twentytwenty-container').each(function(){ 508 var $that = $(this); 509 $(this).imagesLoaded(function(){ 510 $that.twentytwenty(); 511 }); 512 }); 513 514 515/***************** Home Slider ******************/ 516 517 var sliderAdvanceSpeed = parseInt($('#featured').attr('data-advance-speed')); 518 var sliderAnimationSpeed = parseInt($('#featured').attr('data-animation-speed')); 519 var sliderAutoplay = parseInt($('#featured').attr('data-autoplay')); 520 521 if( isNaN(sliderAdvanceSpeed) ) { sliderAdvanceSpeed = 5500;} 522 if( isNaN(sliderAnimationSpeed) ) { sliderAnimationSpeed = 800;} 523 524 var $yPos; 525 526 527 var img_urls=[]; 528 $('[style*="background"]').each(function() { 529 var style = $(this).attr('style'); 530 var pattern = /background.*?url\('(.*?)'\)/g 531 var match = pattern.exec(style); 532 if (match) { 533 img_urls.push(match[1]); 534 } 535 }); 536 537 var imgArray = []; 538 539 for(i=0;i<img_urls.length;i++){ 540 imgArray[i] = new Image(); 541 imgArray[i].src = img_urls[i]; 542 } 543 544 545 //home slider height
546 var sliderHeight = parseInt($('#featured').attr('data-slider-height')); 547 if( isNaN(sliderHeight) ) { sliderHeight = 650 } else { sliderHeight = sliderHeight -12 }; 548 549 ////min height if video 550 if( $('#featured .video').length > 0 && sliderHeight < 500) sliderHeight = 500; 551 552 function customSliderHeight(){ 553 if(!$('body').hasClass('mobile')){ 554 $('#featured').attr('style', 'height: '+sliderHeight+'px !important'); 555 $('#featured article').css('height',sliderHeight+headerPadding2-23+'px') 556 } 557 else { 558 $('#featured').attr('style', 'height: '+sliderHeight+'px'); 559 } 560 561 //transparent header fix 562 if($('#header-outer[data-transparent-header="true"]').length > 0) $('.orbit-wrapper').addClass('transparent-header'); 563 } 564 565 customSliderHeight(); 566 567 568 569 570 //take into account header height when calculating the controls and info positioning 571 var logoHeight = parseInt($('#header-outer').attr('data-logo-height')); 572 var headerPadding = parseInt($('#header-outer').attr('data-padding')); 573 var headerPadding2 = parseInt($('#header-outer').attr('data-padding')); 574 var extraDef = 10; 575 var headerResize = ($('body').hasClass('pp-video-function')) ? '1' : $('#header-outer').attr('data-header-resize'); 576 var headerResizeOffExtra = 0; 577 var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar 578 var usingLogoImage = true; 579 var mediaElement = ($('.wp-video-shortcode').length > 0) ? 36 : 0; 580 var secondaryHeader = ($('#header-outer').attr('data-using-secondary') == '1') ? 32 : 0 ; 581 582 if( isNaN(logoHeight) ) { usingLogoImage = false; logoHeight = 30;} 583 if( isNaN(headerPadding) ) { headerPadding = 28; headerPadding2 = 28;} 584 if( headerResize.length == 0 ) { extraDef = 0; headerResizeOffExtra = headerPadding2; } 585 if( $('header#top #logo img').length == 0 ) { logoHeight = 30; } 586 587 var $captionPos = (((sliderHeight-70)/2 - $('div.slider-nav span.left span.white').height()/2) + headerPadding2 - headerResizeOffExtra) - 75; 588 var $controlsPos = (((sliderHeight-70)/2 - $('div.slider-nav span.left span.white').height()/2) + logoHeight + headerPadding*2 + extraHeight + secondaryHeader) -10; 589 590 var $scrollTop = 0; 591 var $videoHeight; 592 593 594 function homeSliderInit(){ 595 $('#featured').orbit({ 596 animation: 'fade', 597 advanceSpeed: sliderAdvanceSpeed, 598 animationSpeed: sliderAnimationSpeed, 599 timer: sliderAutoplay 600 }); 601 602 customSliderHeight(); 603 sliderAfterSetup(); 604 605 //test for slider arrows 606 if(!$('body').hasClass('mobile')){ 607 $('.orbit-wrapper #featured article').css('top', ((- $scrollTop / 5)+logoHeight+headerPadding2+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader) + 'px'); 608 $('.orbit-wrapper div.slider-nav span.right, .orbit-wrapper div.slider-nav span.left').html('<span class="white"></span><span class="shadow"></span>'); 609 } else { 610 $('.orbit-wrapper div.slider-nav span.right').html('<i class="icon-angle-right"></i>'); 611 $('.orbit-wrapper div.slider-nav span.left').html('<i class="icon-angle-left"></i>'); 612 } 613 } 614 615 //home slider init 616 function homeSliderInit2(){ 617 if($('#featured').length > 0 && $().orbit) { 618 619 $('#featured article .post-title h2 span').show(); 620 621 622 //home slider bg color 623 var sliderBackgroundColor = $('#featured').attr('data-bg-color'); 624 if( sliderBackgroundColor.length == 0 ) sliderBackgroundColor = '#000000'; 625 626 $('#featured article').css('background-color',sliderBackgroundColor); 627 628 629 630 var $firstBg = $('#featured').find('.slide:first-child > article').attr('style'); 631 632 var pattern = /url\(["']?([^'")]+)['"]?\)/; 633 var match = pattern.exec($firstBg); 634 635 if (match && match[1].indexOf('.') !== -1) { 636 var slideImg = new Image(); 637 slideImg.onload = function(){ 638 homeSliderInit(); 639 } 640 slideImg.src = match[1]; 641 } else { 642 homeSliderInit(); 643 } 644 645 ////add hover effect to slider nav 646 if($('.slider-nav > span').find('.white').length == 0) { 647 $('.slider-nav > span').append('<span class="white"></span><span class="shadow"></span>'); 648 } 649
650 ////swipe for home slider 651 if($('body').hasClass('mobile')){ 652 $('#featured h2, #featured .video').swipe({ 653 swipeRight : function(e) { 654 $('.slider-nav .left').trigger('click'); 655 e.stopImmediatePropagation(); 656 return false; 657 }, 658 swipeLeft : function(e) { 659 $('.slider-nav .right').trigger('click'); 660 e.stopImmediatePropagation(); 661 return false; 662 } 663 }) 664 } 665 666 667 } 668 } 669 homeSliderInit2(); 670 671 672 673 //inital load 674 function sliderAfterSetup(){ 675 //webkit video fix 676 $('#featured .mejs-container').css('width',$('#featured .video').width()); 677 $('#featured .mejs-container').css('height',$('#featured .video').width()/1.7777); 678 //$(window).trigger('resize'); 679 680 $('body:not(.mobile) .orbit-wrapper #featured .orbit-slide:not(".has-video") article .container').css('top', $captionPos +"px"); 681 $('body:not(.mobile) .orbit-wrapper #featured .orbit-slide.has-video article .container').css('top', $videoHeight +"px"); 682 $('body:not(.mobile) .orbit-wrapper .slider-nav > span').css('top', $controlsPos +"px"); 683 $('body:not(.mobile) .orbit-wrapper #featured .slide article').css({'top': ((- $scrollTop / 5)+logoHeight+headerPadding2+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader) + 'px' }); 684 685 //height fix for when resize on scroll if off 686 if(!$('body').hasClass('mobile') && headerResize.length == 0){ 687 $('#featured article').css('height',sliderHeight-32+'px') 688 } 689 690 $(window).trigger('resize'); 691 } 692 693 694 function videoSlidePos(){ 695 $('#featured > div').has('.video').each(function(){ 696 if( $(window).width() > 1300 ) { 697 $('#featured .orbit-slide.has-video .video, #featured .orbit-slide.has-video h2').css('top','0'); 698 $('#featured .orbit-slide.has-video .post-title > a').css('top','10px'); 699 700 $videoHeight = ((sliderHeight-28)/2) - ((410-mediaElement)/2) + headerPadding2 - headerResizeOffExtra; 701 } 702 703 else if( $(window).width() > 1000 && $(window).width() < 1081 ){ 704 $('#featured .orbit-slide.has-video .video, #featured .orbit-slide.has-video h2').css('top','0'); 705 $('#featured .orbit-slide.has-video .post-title > a').css('top','10px'); 706 707 $videoHeight = ((sliderHeight-28)/2) - ((290-mediaElement)/2) + headerPadding2 - headerResizeOffExtra; 708 } 709 710 else { 711 $videoHeight = ((sliderHeight-28)/2) - ((336-mediaElement)/2) +headerPadding2 - headerResizeOffExtra; 712 } 713 714 }); 715 } 716 717 videoSlidePos(); 718 719 //dynamic controls and info positioning 720 function controlsAndInfoPos(){ 721 $scrollTop = $(window).scrollTop(); 722 723 $('body:not(.mobile) .orbit-wrapper #featured .orbit-slide:not(".has-video") article .container').css({ 724 'opacity' : 1-($scrollTop/(sliderHeight-130)), 725 'top' : ($scrollTop*-0.2) + $captionPos +"px" 726 }); 727 728 //video slides 729 $('body:not(.mobile) .orbit-wrapper #featured .orbit-slide.has-video article .container').css({ 730 'opacity' : 1-($scrollTop/(sliderHeight-130)), 731 'top' : ($scrollTop*-0.2) + $videoHeight +"px" 732 }); 733 734 if($('#boxed').length == 0){ 735 $('body:not(.mobile) .orbit-wrapper .slider-nav > span').css({ 736 'opacity' : 1-($scrollTop/(sliderHeight-130)), 737 'top' : ($scrollTop*-0.4) + $controlsPos +"px" 738 }); 739 } 740 741 } 742 743 controlsInit(); 744 function controlsInit(){ 745 746 if($('#boxed').length > 0) { 747 if(1-$scrollTop/(sliderHeight-$controlsPos-20) >= 0){ 748 $(window).off('scroll',hideControls); 749 $(window).on('scroll',showControls); 750 } else { 751 $(window).off('scroll',showControls); 752 $(window).on('scroll',hideControls); 753 } 754 } else { 755 $(window).off('scroll',showControls); 756 $(window).off('scroll',hideControls); 757 } 758 759 } 760 761 function showControls(){ 762 763 if(1-$scrollTop/(sliderHeight-$controlsPos-20) >= 0){ 764 $('body:not(.mobile) .orbit-wrapper .slider-nav > span.left').stop(true,true).animate({ 'left' : '0px'},450,'easeOutCubic'); 765 if($('body').attr('data-smooth-scrolling')=='1'){ 766 $('body:not(.mobile) .orbit-wrapper .slider-nav > span.right').stop(true,true).animate({ 'right' : '15px'},450,'easeOutCubic'); 767 } else { 768 $('body:not(.mobile) .orbit-wrapper .slider-nav > span.right').stop(true,true).animate({ 'right' : '0px'},450,'easeOutCubic'); 769 } 770 $(window).off('scroll',showControls); 771 $(window).on('scroll',hideControls); 772 } 773 } 774 775 function hideControls(){ 776 777 if(1-$scrollTop/(sliderHeight-$controlsPos-20) < 0){ 778 $('body:not(.mobile) .orbit-wrapper .slider-nav > span.left').stop(true,true).animate({ 'left' : '-80px'},450,'easeOutCubic'); 779 $('body:not(.mobile) .orbit-wrapper .slider-nav > span.right').stop(true,true).animate({ 'right' : '-80px'},450,'easeOutCubic'); 780 $(window).off('scroll',hideControls); 781 $(window).on('scroll',showControls); 782 } 783 784 } 785 786 787 function homeSliderParallaxScroll(){ 788 789 //hide video to not mess up parallax section 790 $('#featured .mejs-mediaelement, #featured .iframe-embed').each(function(){ 791 792 if( $(this).parents('.container').css('opacity') <= 0){ 793 $(this).css('visibility','hidden').hide(); 794 } else { 795 $(this).css('visibility','visible').show(); 796 } 797 }); 798 799 if(!$('body').hasClass('mobile')){ 800 801 controlsAndInfoPos(); 802 $('body:not(.mobile) .orbit-wrapper #featured .slide:not(:transparent) article').css({'top': ((- $scrollTop / 5)+logoHeight+headerPadding2+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader) + 'px' }); 803 804 } 805 } 806 807 function homeSliderMobile() { 808 809 if(!$('body').hasClass('mobile')){ 810 $('.orbit-wrapper #featured article').css('top', ((- $scrollTop / 5)+logoHeight+headerPadding2+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader) + 'px'); 811 $('.orbit-wrapper div.slider-nav span.right, .orbit-wrapper div.slider-nav span.left').html('<span class="white"></span><span class="shadow"></span>'); 812 } else { 813 $('.orbit-wrapper div.slider-nav span.right').html('<i class="icon-angle-right"></i>'); 814 $('.orbit-wrapper div.slider-nav span.left').html('<i class="icon-angle-left"></i>'); 815 } 816 817 videoSlidePos(); 818 controlsAndInfoPos(); 819 customSliderHeight(); 820 821 //height fix for when resize on scroll if off 822 if(!$('body').hasClass('mobile') && headerResize.length == 0){ 823 $('#featured article').css('height',sliderHeight-32+'px') 824 } 825 826 } 827 828 829 if( $('#featured').length > 0){ 830 831 $(window).off('scroll.hsps'); 832 $(window).on('scroll.hsps',homeSliderParallaxScroll); 833 834 //disable parallax for mobile 835 $(window).off('resize.hsps'); 836 $(window).on('resize.hsps',homeSliderMobile); 837 838 } 839 840
841 //webkit self-hosted video fix 842 $('.jp-video-container .jp-play, jp-video-container .jp-seek-bar').click(function(){ 843 $(this).parents('.jp-video-container').prev('.jp-jplayer').find('video').show().css('display','block'); 844 $(this).parents('.jp-video-container').prev('.jp-jplayer').find('.jp-jplayer > img').hide(); 845 }); 846 847 //mobile video more info 848 $('#featured .span_12 a.more-info').click(function(){ 849 if( !$(this).find('.btv').is(":visible")){ 850 $(this).parent().parent().find('h2, > a').css('opacity',1); 851 $(this).parent().parent().find('.video').stop().animate({'top':'-400px'},800,'easeOutCubic'); 852 $(this).parent().parent().find('h2').stop().animate({'top':'-400px'},800,'easeOutCubic'); 853 $(this).parent().parent().find('> a').stop().animate({'top':'-380px'},800,'easeOutCubic'); 854 $(this).find('.btv').show(); 855 $(this).find('.mi').hide(); 856 } 857 else { 858 $(this).parent().parent().find('.video').stop().animate({'top':'0px'},800,'easeOutCubic'); 859 $(this).parent().parent().find('h2').stop().animate({'top':'0px'},800,'easeOutCubic'); 860 $(this).parent().parent().find('> a').stop().animate({'top':'0px'},800,'easeOutCubic'); 861 $(this).find('.mi').show(); 862 $(this).find('.btv').hide(); 863 } 864 865 return false; 866 }); 867 868/***************** Superfish ******************/ 869 870 function initSF(){ 871 872 $(".sf-menu").superfish({ 873 delay: 700, 874 speed: 'fast', 875 speedOut: 'fast', 876 animation: {opacity:'show'} 877 }); 878 879 } 880 881 var $navLeave; 882 883 /*$('header#top nav > ul > li').hover(function(){ 884 if(!$(this).hasClass('megamenu')){ 885 886 } 887 });*/ 888 889 890 function addOrRemoveSF(){ 891 892 if( window.innerWidth < 1000 && $('body').attr('data-responsive') == '1'){ 893 $('body').addClass('mobile'); 894 $('header#top nav').hide(); 895 } 896 897 else { 898 $('body').removeClass('mobile'); 899 $('header#top nav').show(); 900 $('#mobile-menu').hide(); 901 902 //recalc height of dropdown arrow 903 $('.sf-sub-indicator').css('height',$('a.sf-with-ul').height()); 904 } 905 906 //add specific class if on device for better tablet tracking 907 if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) $('body').addClass('using-mobile-browser'); 908 909 } 910 911 addOrRemoveSF(); 912 initSF(); 913 914 $(window).resize(addOrRemoveSF); 915 916 917 function SFArrows(){ 918 919 //set height of dropdown arrow 920 $('.sf-sub-indicator').css('height',$('a.sf-with-ul').height()); 921 } 922 923 SFArrows(); 924 925 926 //deactivate hhun on phone 927 if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)) 928 $('body').attr('data-hhun','0'); 929 930 931/***************** Caroufredsel ******************/ 932 933 function standardCarouselInit() { 934 $('.carousel:not(".clients")').each(function(){ 935 var $that = $(this); 936 var maxCols = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true') ? 'auto' : 3 ; 937 var scrollNum = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true') ? 'auto' : '' ; 938 var colWidth = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true') ? 500 : 453 ; 939 var scrollSpeed, easing; 940 var $autoplayBool = ($(this).attr('data-autorotate') == 'true') ? true : false; 941 942 if($('body.ascend').length > 0 && $(this).parents('.carousel-wrap').attr('data-full-width') != 'true') { 943 if($(this).find('li').length % 3 === 0) { 944 var $themeSkin = true; 945 var $themeSkin2 = true; 946 } else { 947 var $themeSkin = false; 948 var $themeSkin2 = true; 949 } 950 951 } else { 952 var $themeSkin = true; 953 var $themeSkin2 = true; 954 } 955 956 (parseInt($(this).attr('data-scroll-speed'))) ? scrollSpeed = parseInt($(this).attr('data-scroll-speed')) : scrollSpeed = 700; 957 ($(this).attr('data-easing').length > 0) ? easing = $(this).attr('data-easing') : easing = 'linear'; 958 959 960 var $element = $that; 961 if($that.find('img').length == 0) $element = $('body'); 962 963 imagesLoaded($element,function(instance){ 964 965 966 $that.carouFredSel({ 967 circular: $themeSkin, 968 infinite: $themeSkin2, 969 height : 'auto', 970 responsive: true, 971 items : { 972 width : colWidth, 973 visible : { 974 min : 1, 975 max : maxCols 976 } 977 }, 978 swipe : { 979 onTouch : true, 980 onMouse : true, 981 options : { 982 excludedElements: "button, input, select, textarea, .noSwipe", 983 tap: function(event, target){ if($(target).attr('href') && !$(target).is('[target="_blank"]') && !$(target).is('[rel^="prettyPhoto"]') && !$(target).is('.magnific-popup') && !$(target).is('.magnific')) window.open($(target).attr('href'), '_self'); } 984 }, 985 onBefore : function(){ 986 //hover effect fix 987 $that.find('.work-item').trigger('mouseleave'); 988 $that.find('.work-item .work-info a').trigger('mouseup'); 989 } 990 }, 991 scroll: { 992 items : scrollNum, 993 easing : easing, 994 duration : scrollSpeed, 995 onBefore : function( data ) { 996 997 if($('body.ascend').length > 0 && $that.parents('.carousel-wrap').attr('data-full-width') != 'true') { 998 $that.parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($that.find('li').length / $that.triggerHandler("currentVisible").length)); 999 1000 } 1001 }, 1002 onAfter : function( data ) { 1003 if($('body.ascend').length > 0 && $that.parents('.carousel-wrap').attr('data-full-width') != 'true') { 1004 $that.parents('.carousel-wrap').find('.item-count .current').html( $that.triggerHandler('currentPage') +1); 1005 $that.parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($that.find('li').length / $that.triggerHandler("currentVisible").length)); 1006 1007 } 1008 } 1009 1010 }, 1011 prev : { 1012 button : function() { 1013 return $that.parents('.carousel-wrap').find('.carousel-prev'); 1014 } 1015 }, 1016 next : { 1017 button : function() { 1018 return $that.parents('.carousel-wrap').find('.carousel-next'); 1019 } 1020 }, 1021 auto : { 1022 play: $autoplayBool 1023 } 1024 }, { transition: true }).animate({'opacity': 1},1300); 1025 1026 $that.parents('.carousel-wrap').wrap('<div class="carousel-outer">'); 1027 1028 if($that.parents('.carousel-wrap').attr('data-full-width') == 'true') $that.parents('.carousel-outer').css('overflow','visible'); 1029 1030 //add count for non full width ascend skin 1031 if($('body.ascend').length > 0 && $that.parents('.carousel-wrap').attr('data-full-width') != 'true') { 1032 $('<div class="item-count"><span class="current">1</span>/<span class="total">'+$that.find('li').length / $that.triggerHandler("currentVisible").length +'</span></div>').insertAfter($that.parents('.carousel-wrap').find('.carousel-prev'));
1033 } 1034 1035 $that.addClass('finished-loading'); 1036 1037 carouselHeightCalcs(); 1038 1039 //reinit panr 1040 if(!$('body').hasClass('mobile') && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)) { 1041 $(".portfolio-items.carousel .work-item.style-3 img").panr({ 1042 scaleDuration: .28 1043 }); 1044 $(".portfolio-items:not(.carousel) .work-item.style-3-alt img").panr({ scaleDuration: .28, sensitivity: 12.6, scaleTo: 1.08, panDuration: 3 }); 1045 } 1046 1047 1048 });//images loaded 1049 1050 });//each 1051 } 1052 if($('.carousel').length > 0) standardCarouselInit(); 1053 1054 1055 1056 1057 function productCarouselInit() { 1058 $('.products-carousel').each(function(){ 1059 var $that = $(this).find('ul'); 1060 var maxCols = 'auto'; 1061 var scrollNum = 'auto'; 1062 var colWidth = ($(this).parents('.full-width-content ').length > 0) ? 400 : 353 ; 1063 var scrollSpeed = 800; 1064 var easing = 'easeInOutQuart'; 1065 1066 1067 var $element = $that; 1068 if($that.find('img').length == 0) $element = $('body'); 1069 1070 //controls on hover 1071 $(this).append('<a class="carousel-prev" href="#"><i class="icon-salient-left-arrow"></i></a> <a class="carousel-next" href="#"><i class="icon-salient-right-arrow"></i></a>') 1072 1073 imagesLoaded($element,function(instance){ 1074 1075 1076 $that.carouFredSel({ 1077 circular: true, 1078 responsive: true, 1079 items : { 1080 width : colWidth, 1081 visible : { 1082 min : 1, 1083 max : maxCols 1084 } 1085 }, 1086 swipe : { 1087 onTouch : true, 1088 onMouse : true, 1089 options : { 1090 excludedElements: "button, input, select, textarea, .noSwipe", 1091 tap: function(event, target){ 1092 if($(target).attr('href') && !$(target).is('[target="_blank"]') && !$(target).hasClass('add_to_wishlist') && !$(target).hasClass('add_to_cart_button') && !$(target).is('[rel^="prettyPhoto"]')) 1093 window.open($(target).attr('href'), '_self'); 1094 if($(target).parent().attr('href') && !$(target).parent().is('[target="_blank"]') && !$(target).parent().hasClass('add_to_wishlist') && !$(target).parent().hasClass('add_to_cart_button') && !$(target).parent().is('[rel^="prettyPhoto"]')) 1095 window.open($(target).parent().attr('href'), '_self'); 1096 } 1097 }, 1098 onBefore : function(){ 1099 //hover effect fix 1100 $that.find('.product-wrap').trigger('mouseleave'); 1101 $that.find('.product a').trigger('mouseup'); 1102 } 1103 }, 1104 scroll: { 1105 items : scrollNum, 1106 easing : easing, 1107 duration : scrollSpeed 1108 }, 1109 prev : { 1110 button : function() { 1111 return $that.parents('.carousel-wrap').find('.carousel-prev'); 1112 } 1113 }, 1114 next : { 1115 button : function() { 1116 return $that.parents('.carousel-wrap').find('.carousel-next'); 1117 } 1118 }, 1119 auto : { 1120 play: false 1121 } 1122 }).animate({'opacity': 1},1300); 1123 1124 $that.parents('.carousel-wrap').wrap('<div class="carousel-outer">'); 1125 1126 $that.addClass('finished-loading'); 1127 fullWidthContentColumns(); 1128 $(window).trigger('resize'); 1129 1130 });//images loaded 1131 1132 });//each 1133 } 1134 if($('.products-carousel').length > 0) productCarouselInit(); 1135 1136 1137 1138 1139 1140 //fullwidth carousel swipe link fix 1141 function fwCarouselLinkFix() { 1142 var $mousePosStart = 0; 1143 var $mousePosEnd = 0; 1144 $('.carousel-wrap .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').mousedown(function(e){ 1145 $mousePosStart = e.clientX; 1146 }); 1147 1148 $('.carousel-wrap .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').mouseup(function(e){
1149 $mousePosEnd = e.clientX; 1150 }); 1151 1152 $('.carousel-wrap .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a').click(function(e){ 1153 if(Math.abs($mousePosStart - $mousePosEnd) > 10) return false; 1154 }); 1155 } 1156 fwCarouselLinkFix(); 1157 1158 1159 function carouselHeightCalcs(){ 1160 1161 //recent work carousel 1162 $('.carousel.portfolio-items.finished-loading').each(function(){ 1163 1164 var bottomSpace = ($(this).parents('.carousel-wrap').attr('data-full-width') == 'true' && $(this).find('.style-2, .style-3, .style-4').length > 0) ? 0 : 28 ; 1165 1166 var tallestMeta = 0; 1167 1168 $(this).find('> li').each(function(){ 1169 ($(this).find('.work-meta').height() > tallestMeta) ? tallestMeta = $(this).find('.work-meta').height() : tallestMeta = tallestMeta; 1170 }); 1171 1172 $(this).parents('.caroufredsel_wrapper').css({ 1173 'height' : ($(this).find('.work-item').outerHeight() + tallestMeta + bottomSpace -2) + 'px' 1174 }); 1175 1176 if($('body.ascend').length > 0 && $(this).parents('.carousel-wrap').attr('data-full-width') != 'true') { 1177 $(this).parents('.carousel-wrap').find('.item-count .current').html(Math.ceil(($(this).triggerHandler("currentPosition")+1)/$(this).triggerHandler("currentVisible").length)); 1178 $(this).parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($(this).find('li').length / $(this).triggerHandler("currentVisible").length)); 1179 } 1180 }); 1181 1182 //standard carousel 1183 $('.carousel.finished-loading:not(".portfolio-items, .clients"), .caroufredsel_wrapper .products.finished-loading').each(function(){ 1184 1185 var tallestColumn = 0; 1186 1187 $(this).find('> li').each(function(){ 1188 ($(this).height() > tallestColumn) ? tallestColumn = $(this).height() : tallestColumn = tallestColumn; 1189 }); 1190 1191 $(this).css('height',tallestColumn + 5); 1192 $(this).parents('.caroufredsel_wrapper').css('height',tallestColumn + 5); 1193 1194 if($('body.ascend').length > 0 && $(this).parents('.carousel-wrap').attr('data-full-width') != 'true') { 1195 $(this).parents('.carousel-wrap').find('.item-count .current').html(Math.ceil(($(this).triggerHandler("currentPosition")+1)/$(this).triggerHandler("currentVisible").length)); 1196 $(this).parents('.carousel-wrap').find('.item-count .total').html(Math.ceil($(this).find('li').length / $(this).triggerHandler("currentVisible").length)); 1197 } 1198 1199 }); 1200 1201 } 1202 1203 1204 function clientsCarouselInit(){ 1205 $('.carousel.clients').each(function(){ 1206 var $that = $(this); 1207 var columns; 1208 var $autoRotate = (!$(this).hasClass('disable-autorotate')) ? true : false; 1209 (parseInt($(this).attr('data-max'))) ? columns = parseInt($(this).attr('data-max')) : columns = 5; 1210 if($(window).width() < 690 && $('body').attr('data-responsive') == '1') { columns = 2; $(this).addClass('phone') } 1211 1212 var $element = $that; 1213 if($that.find('img').length == 0) $element = $('body'); 1214 1215 imagesLoaded($element,function(instance){ 1216 1217 $that.carouFredSel({ 1218 circular: true, 1219 responsive: true, 1220 items : { 1221 1222 height : $that.find('> div:first').height(), 1223 width : $that.find('> div:first').width(), 1224 visible : { 1225 min : 1, 1226 max : columns 1227 } 1228 }, 1229 swipe : { 1230 onTouch : true, 1231 onMouse : true 1232 }, 1233 scroll: { 1234 items : 1, 1235 easing : 'easeInOutCubic', 1236 duration : '800', 1237 pauseOnHover : true 1238 }, 1239 auto : { 1240 play : $autoRotate, 1241 timeoutDuration : 2700 1242 } 1243 }).animate({'opacity': 1},1300); 1244 1245 $that.addClass('finished-loading'); 1246 1247 $that.parents('.carousel-wrap').wrap('<div class="carousel-outer">'); 1248 1249 1250 $(window).trigger('resize'); 1251 1252 1253 }); 1254 1255 }); 1256 } 1257 if($('.carousel').length > 0) clientsCarouselInit(); 1258 1259 1260 function clientsCarouselHeightRecalc(){ 1261 1262 var tallestImage = 0; 1263 1264 $('.carousel.clients.finished-loading').each(function(){ 1265 1266 $(this).find('> div').each(function(){ 1267 ($(this).height() > tallestImage) ? tallestImage = $(this).height() : tallestImage = tallestImage; 1268 }); 1269 1270 $(this).css('height',tallestImage); 1271 $(this).parent().css('height',tallestImage); 1272 }); 1273 } 1274 1275 1276 //carousel grabbing class 1277 function carouselfGrabbingClass() { 1278 $('body').on('mousedown','.caroufredsel_wrapper, .carousel-wrap[data-full-width="true"] .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a',function(){ 1279 $(this).addClass('active'); 1280 }); 1281 1282 $('body').on('mouseup','.caroufredsel_wrapper, .carousel-wrap[data-full-width="true"] .portfolio-items .col .work-item .work-info a, .woocommerce .products-carousel ul.products li.product a',function(){ 1283 $(this).removeClass('active'); 1284 }); 1285 } 1286 carouselfGrabbingClass(); 1287 1288 1289 //ascend arrow hover class 1290 $('body.ascend').on('mouseover','.carousel-next',function(){ 1291 $(this).parent().find('.carousel-prev, .item-count').addClass('next-hovered'); 1292 }); 1293 $('body.ascend').on('mouseleave','.carousel-next',function(){ 1294 $(this).parent().find('.carousel-prev, .item-count').removeClass('next-hovered'); 1295 }); 1296 1297 //fadein for clients / carousels 1298 function clientsFadeIn() { 1299 1300 $('.clients.fade-in-animation').each(function() { 1301 1302 var $that = $(this); 1303 var waypoint = new Waypoint({ 1304 element: $that, 1305 handler: function(direction) { 1306 1307 if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 1308 waypoint.destroy(); 1309 return; 1310 } 1311 1312 $that.find('> div').each(function(i){ 1313 $(this).delay(i*80).transition({'opacity':"1"},450); 1314 }); 1315 1316 1317 //add the css transition class back in after the aniamtion is done 1318 setTimeout(function(){ $that.addClass('completed'); },($that.find('> div').length*80) + 450); 1319 1320 1321 $that.addClass('animated-in'); 1322 waypoint.destroy(); 1323 }, 1324 offset: 'bottom-in-view' 1325 1326 }); 1327 }); 1328 } 1329 1330 if($('.nectar-box-roll').length == 0) clientsFadeIn(); 1331 1332 1333/*-------------------------------------------------------------------------*/ 1334/* 2. Helper Functions 1335/*-------------------------------------------------------------------------*/ 1336 1337 jQuery.fn.setCursorPosition = function(position){ 1338 if(this.lengh == 0) return this; 1339 return $(this).setSelection(position, position); 1340 } 1341 1342 jQuery.fn.setSelection = function(selectionStart, selectionEnd) { 1343 if(this.lengh == 0) return this; 1344 input = this[0]; 1345 1346 if (input.createTextRange) { 1347 var range = input.createTextRange(); 1348 range.collapse(true); 1349 range.moveEnd('character', selectionEnd); 1350 range.moveStart('character', selectionStart); 1351 range.select(); 1352 } else if (input.setSelectionRange) { 1353 input.focus(); 1354 input.setSelectionRange(selectionStart, selectionEnd); 1355 } 1356 1357 return this; 1358 } 1359 1360 1361 1362 $.extend($.expr[':'], { 1363 transparent: function(elem, i, attr){ 1364 return( $(elem).css("opacity") === "0" ); 1365 } 1366 }); 1367 1368 1369 function getQueryParams(qs) { 1370 qs = qs.split("+").join(" "); 1371 var params = {}, 1372 tokens, 1373 re = /[?&]?([^=]+)=([^&]*)/g; 1374 1375 while (tokens = re.exec(qs)) { 1376 params[decodeURIComponent(tokens[1])] 1377 = decodeURIComponent(tokens[2]); 1378 } 1379 1380 return params; 1381 } 1382 1383 var $_GET = getQueryParams(document.location.search); 1384 1385 1386 //count 1387 $.fn.countTo = function (options) { 1388 options = options || {}; 1389 1390 return $(this).each(function () { 1391 // set options for current element 1392 var settings = $.extend({}, $.fn.countTo.defaults, { 1393 from: $(this).data('from'), 1394 to: $(this).data('to'), 1395 speed: $(this).data('speed'), 1396 refreshInterval: $(this).data('refresh-interval'), 1397 decimals: $(this).data('decimals') 1398 }, options); 1399 1400 // how many times to update the value, and how much to increment the value on each update 1401 var loops = Math.ceil(settings.speed / settings.refreshInterval), 1402 increment = (settings.to - settings.from) / loops; 1403 1404 // references & variables that will change with each update 1405 var self = this, 1406 $self = $(this), 1407 loopCount = 0, 1408 value = settings.from, 1409 data = $self.data('countTo') || {}; 1410 1411 $self.data('countTo', data); 1412 1413 // if an existing interval can be found, clear it first 1414 if (data.interval) { 1415 clearInterval(data.interval); 1416 } 1417 data.interval = setInterval(updateTimer, settings.refreshInterval); 1418 1419 // initialize the element with the starting value 1420 render(value); 1421 1422 function updateTimer() { 1423 value += increment; 1424 loopCount++; 1425 1426 render(value); 1427
1428 if (typeof(settings.onUpdate) == 'function') { 1429 settings.onUpdate.call(self, value); 1430 } 1431 1432 if (loopCount >= loops) { 1433 // remove the interval 1434 $self.removeData('countTo'); 1435 clearInterval(data.interval); 1436 value = settings.to; 1437 1438 if (typeof(settings.onComplete) == 'function') { 1439 settings.onComplete.call(self, value); 1440 } 1441 } 1442 } 1443 1444 function render(value) { 1445 var formattedValue = settings.formatter.call(self, value, settings); 1446 $self.html(formattedValue); 1447 } 1448 }); 1449 }; 1450 1451 $.fn.countTo.defaults = { 1452 from: 0, // the number the element should start at 1453 to: 0, // the number the element should end at 1454 speed: 1000, // how long it should take to count between the target numbers 1455 refreshInterval: 100, // how often the element should be updated 1456 decimals: 0, // the number of decimal places to show 1457 formatter: formatter, // handler for formatting the value before rendering 1458 onUpdate: null, // callback method for every time the element is updated 1459 onComplete: null // callback method for when the element finishes updating 1460 }; 1461 1462 function formatter(value, settings) { 1463 return value.toFixed(settings.decimals); 1464 } 1465 1466 1467 1468 1469/*-------------------------------------------------------------------------*/ 1470/* 3. Shortcode Stuff 1471/*-------------------------------------------------------------------------*/ 1472 1473 1474/***************** Milestone Counter ******************/ 1475 1476 function milestoneInit() { 1477 $('.nectar-milestone').each(function() { 1478 1479 //symbol 1480 if($(this).is('[data-symbol]')) { 1481 if($(this).attr('data-symbol-pos') == 'before') { 1482 $(this).find('.number').prepend('<div class="symbol-wrap"><span class="symbol">' + $(this).attr('data-symbol') + '</span></div>'); 1483 } else { 1484 $(this).find('.number').append('<div class="symbol-wrap"><span class="symbol">' + $(this).attr('data-symbol') + '</span></div>'); 1485 } 1486 1487 $symbol_size = ( $(this).attr('data-symbol-size') == $(this).find('.number').attr('data-number-size') && $(this).attr('data-symbol-alignment') == 'superscript' ) ? 32 : parseInt($(this).attr('data-symbol-size')); 1488 1489 $(this).find('.symbol-wrap').css({'font-size': $symbol_size + 'px', 'line-height': $symbol_size + 'px'}); 1490 } 1491 1492 $(this).find('.number').css({'font-size': $(this).find('.number').attr('data-number-size') +'px', 'line-height': $(this).find('.number').attr('data-number-size') + 'px'}); 1493 }); 1494 1495 if(!$('body').hasClass('mobile')) { 1496 1497 1498 //blur effect 1499 var $blurCssString = ''; 1500 $('.nectar-milestone.motion_blur').each(function(i){ 1501 1502 $(this).addClass('instance-'+i); 1503 1504 var $currentColor = $(this).find('.number').css('color'); 1505 var colorInt = parseInt($currentColor.substring(1),16); 1506 var R = (colorInt & 0xFF0000) >> 16; 1507 var G = (colorInt & 0x00FF00) >> 8; 1508 var B = (colorInt & 0x0000FF) >> 0; 1509 1510 var $rgbaColorStart = 'rgba('+R+','+G+','+B+',0.2)'; 1511 var $rgbaColorEnd = 'rgba('+R+','+G+','+B+',1)'; 1512 var $numberSize = parseInt($(this).find('.number').attr('data-number-size')); 1513 1514 $blurCssString += '@keyframes motion-blur-number-'+i+' { ' + 1515 ' 0% { '+ 1516 'opacity: 0;'+ 1517 'color: '+$rgbaColorStart+'; '+ 1518 'text-shadow: 0 '+$numberSize/20+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/10+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/6+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/5+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/4+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/20+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/10+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/6+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/5+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/4+'px 0 '+$rgbaColorStart+'; '+ 1519 'transform: translateZ(0px) translateY(-100%); '+ 1520 '-webkit-transform: translateZ(0px) translateY(-100%); '+ 1521 '} '+ 1522 '33% { opacity: 1 }' + 1523 '100% { '+ 1524 'color: '+$rgbaColorEnd+'; '+ 1525 'text-shadow: none; '+ 1526 'transform: translateZ(0px) translateY(0px); '+ 1527 '-webkit-transform: translateZ(0px) translateY(0px); '+ 1528 '} '+ 1529 '} '+ 1530 '@-webkit-keyframes motion-blur-number-'+i+' { ' + 1531 ' 0% { '+ 1532 'opacity: 0;'+ 1533 'color: '+$rgbaColorStart+'; '+ 1534 'text-shadow: 0 '+$numberSize/20+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/10+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/6+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/5+'px 0 '+$rgbaColorStart+', 0 '+$numberSize/4+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/20+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/10+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/6+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/5+'px 0 '+$rgbaColorStart+', 0 -'+$numberSize/4+'px 0 '+$rgbaColorStart+'; '+ 1535 'transform: translateZ(0px) translateY(-100%); '+ 1536 '-webkit-transform: translateZ(0px) translateY(-100%); '+ 1537 '} '+ 1538 '33% { opacity: 1 }' + 1539 '100% { '+ 1540 'color: '+$rgbaColorEnd+'; '+ 1541 'text-shadow: none; '+ 1542 'transform: translateZ(0px) translateY(0px); '+ 1543 '-webkit-transform: translateZ(0px) translateY(0px); '+ 1544 '} '+ 1545 '} '+ 1546 '.nectar-milestone.motion_blur.instance-'+i+' .number span.in-sight { animation: 0.65s cubic-bezier(0, 0, 0.17, 1) 0s normal backwards 1 motion-blur-number-'+i+'; -webkit-animation: 0.65s cubic-bezier(0, 0, 0.17, 1) 0s normal backwards 1 motion-blur-number-'+i+'; } '; 1547 1548 //separate each character into spans 1549 $symbol = $(this).find('.symbol-wrap').clone(); 1550 $(this).find('.symbol-wrap').remove(); 1551 var characters = $(this).find('.number').text().split(""); 1552 $this = $(this).find('.number'); 1553 $this.empty(); 1554 $.each(characters, function (i, el) { 1555 $this.append("<span>" + el + "</span"); 1556 }); 1557 1558 //handle symbol 1559 if($(this).has('[data-symbol]')) { 1560 if($(this).attr('data-symbol-pos') == 'after') { 1561 $this.append($symbol); 1562 } else { 1563 $this.prepend($symbol); 1564 } 1565 } 1566 1567 }); 1568 1569 var head = document.head || document.getElementsByTagName('head')[0]; 1570 var style = document.createElement('style'); 1571 1572 style.type = 'text/css'; 1573 if (style.styleSheet){ 1574 style.styleSheet.cssText = $blurCssString; 1575 } else { 1576 style.appendChild(document.createTextNode($blurCssString)); 1577 } 1578 1579 head.appendChild(style); 1580 1581 1582 //activate 1583 milestoneWaypoint(); 1584 1585 } 1586 1587 } 1588 1589 function milestoneWaypoint() { 1590 $('.nectar-milestone').each(function() { 1591 //animation 1592 var $offset = ($(this).hasClass('motion_blur')) ? '90%' : '105%'; 1593 1594 1595 var $that = $(this); 1596 var waypoint = new Waypoint({ 1597 element: $that, 1598 handler: function(direction) { 1599 1600 if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 1601 waypoint.destroy(); 1602 return; 1603 } 1604 1605 var $endNum = parseInt($that.find('.number span:not(.symbol)').text()); 1606 if(!$that.hasClass('motion_blur')) { 1607 $that.find('.number span:not(.symbol)').countTo({ 1608 from: 0, 1609 to: $endNum, 1610 speed: 1500, 1611 refreshInterval: 30 1612 });
1613 } else { 1614 $that.find('span').each(function(i){ 1615 var $that = $(this); 1616 setTimeout(function(){ $that.addClass('in-sight'); },200*i); 1617 }); 1618 } 1619 1620 1621 $that.addClass('animated-in'); 1622 waypoint.destroy(); 1623 }, 1624 offset: 'bottom-in-view' 1625 1626 }); 1627 1628 }); 1629 } 1630 1631 var $animationOnScrollTimeOut = ($('.nectar-box-roll').length > 0) ? 850: 125; 1632 if($('.nectar-box-roll').length == 0) setTimeout(function(){ milestoneInit(); },125); 1633 1634/***************** Tabbed ******************/ 1635 1636 $tabbedClickCount = 0; 1637 $('body').on('click','.tabbed > ul li:not(.cta-button) a',function(){ 1638 var $id = $(this).parents('li').index()+1; 1639 1640 if(!$(this).hasClass('active-tab') && !$(this).hasClass('loading')){ 1641 $(this).parents('ul').find('a').removeClass('active-tab'); 1642 $(this).addClass('active-tab'); 1643 1644 $(this).parents('.tabbed').find('> div:not(.clear)').css({'visibility':'hidden','position':'absolute','opacity':'0','left':'-9999px','display':'none'}); 1645 $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').css({'visibility':'visible', 'position' : 'relative','left':'0','display':'block'}).stop().transition({'opacity':1},300); 1646 1647 if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+') .iframe-embed').length > 0 || $(this).parents('.tabbed').find('> div:nth-of-type('+$id+') .portfolio-items').length > 0) setTimeout(function(){ $(window).resize(); },10); 1648 } 1649 1650 //waypoint checking 1651 if($tabbedClickCount != 0) { 1652 if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-progress-bar').length > 0 ) 1653 progressBars(); 1654 if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('img.img-with-animation').length > 0 || 1655 $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.col.has-animation').length > 0 || 1656 $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.wpb_column.has-animation').length > 0 ) 1657 colAndImgAnimations(); 1658 if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-milestone').length > 0 ) 1659 milestoneWaypoint(); 1660 if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-fancy-ul').length > 0 ) 1661 nectar_fancy_ul_init(); 1662 if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.nectar-split-heading').length > 0 ) 1663 splitLineHeadings(); 1664 if($(this).parents('.wpb_row').length > 0) { 1665 if($(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.vc_pie_chart').length > 0 || 1666 $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.wp-video-shortcode').length > 0 || 1667 $(this).parents('.tabbed').find('> div:nth-of-type('+$id+')').find('.twentytwenty-container').length > 0 || 1668 $(this).parents('.wpb_row').next().hasClass('parallax_section')) 1669 $(window).trigger('resize'); 1670 } 1671 } 1672 1673 //fix columns inside tabs 1674 $(this).parents('.tabbed').find('.wpb_row').each(function(){ 1675 if(typeof $(this).find('[class*="vc_col-"]').first().offset() != 'undefined') { 1676 1677 var $firstChildOffset = $(this).find('[class*="vc_col-"]').first().offset().left; 1678 $(this).find('[class*="vc_col-"]').each(function(){ 1679 $(this).removeClass('no-left-margin'); 1680 if($(this).offset().left < $firstChildOffset + 15) { 1681 $(this).addClass('no-left-margin'); 1682 } else { 1683 $(this).removeClass('no-left-margin'); 1684 } 1685 }); 1686 } 1687 }); 1688 1689 $tabbedClickCount++; 1690 1691 return false; 1692 }); 1693 1694 //make sure the tabs don't have a nectar slider - we'll init this after the sliders load in that case 1695 function tabbedInit(){ 1696 $('.tabbed').each(function(){ 1697 if($(this).find('.swiper-container').length == 0 && $(this).find('.testimonial_slider').length == 0 && $(this).find('.portfolio-items:not(".carousel")').length == 0 && $(this).find('.wpb_gallery .portfolio-items').length == 0 && $(this).find('iframe').length == 0){ 1698 $(this).find('> ul li:first-child a').click(); 1699 } 1700 if($(this).find('.testimonial_slider').length > 0 || $(this).find('.portfolio-items:not(".carousel")').length > 0 || $(this).find('.wpb_gallery .portfolio-items').length > 0 || $(this).find('iframe').length > 0 ){ 1701 var $that = $(this); 1702 1703 $(this).find('.wpb_tab').show().css({'opacity':0,'height':'1px'}); 1704 $(this).find('> ul li a').addClass('loading'); 1705 1706 setTimeout(function(){ 1707 $that.find('.wpb_tab').hide().css({'opacity':1,'height':'auto'}); 1708 $that.find('> ul li a').removeClass('loading'); 1709 $that.find('> ul li:first-child a').click(); 1710 },900); 1711 } 1712 }); 1713 } 1714 tabbedInit(); 1715 1716 //deep linking 1717 function tabbbedDeepLinking(){ 1718 if(typeof $_GET['tab'] != 'undefined'){ 1719 $('.wpb_tabs_nav').each(function(){ 1720 1721 $(this).find('li').each(function(){ 1722 var $currentText = $(this).find('a').text(); 1723 var $getText = $_GET['tab']; 1724 var $that = $(this); 1725 1726 $currentText = $currentText.replace(/\s+/g, '-').toLowerCase(); 1727 $getText = $getText.replace(/\s+/g, '-').replace(/</g, '<').replace(/"/g, '"').toLowerCase(); 1728 1729 if($currentText == $getText) { 1730 1731 $(this).find('a').click(); 1732 setTimeout(function(){ 1733 $that.find('a').click(); 1734 },901); 1735 } 1736 }) 1737 }); 1738 } 1739 } 1740 tabbbedDeepLinking(); 1741 1742/***************** Toggle ******************/ 1743 1744 //toggles 1745 $('body').on('click','.toggle h3 a', function(){ 1746 1747 if(!$(this).parents('.toggles').hasClass('accordion')) { 1748 $(this).parents('.toggle').find('> div').slideToggle(300); 1749 $(this).parents('.toggle').toggleClass('open'); 1750 1751 //switch icon 1752 if( $(this).parents('.toggle').hasClass('open') ){ 1753 $(this).find('i').attr('class','icon-minus-sign'); 1754 } else { 1755 $(this).find('i').attr('class','icon-plus-sign'); 1756 } 1757 1758 if($(this).parents('.toggle').find('> div .iframe-embed').length > 0 && $(this).parents('.toggle').find('> div .iframe-embed iframe').height() == '0') responsiveVideoIframes(); 1759 if($(this).parents('.full-width-content').length > 0) setTimeout(function(){ fullWidthContentColumns(); },300); 1760 return false; 1761 } 1762 }); 1763 1764 //accordion 1765 $('body').on('click','.accordion .toggle h3 a', function(){ 1766 1767 if($(this).parents('.toggle').hasClass('open')) return false; 1768 1769 $(this).parents('.toggles').find('.toggle > div').slideUp(300); 1770 $(this).parents('.toggles').find('.toggle h3 a i').attr('class','icon-plus-sign'); 1771 $(this).parents('.toggles').find('.toggle').removeClass('open'); 1772 1773 $(this).parents('.toggle').find('> div').slideDown(300); 1774 $(this).parents('.toggle').addClass('open'); 1775 1776 //switch icon 1777 if( $(this).parents('.toggle').hasClass('open') ){ 1778 $(this).find('i').attr('class','icon-minus-sign'); 1779 } else { 1780 $(this).find('i').attr('class','icon-plus-sign'); 1781 } 1782 1783 if($(this).parents('.full-width-content').length > 0) { 1784 clearTimeout($t); 1785 var $t = setTimeout(function(){ fullWidthContentColumns(); },400); 1786 } 1787 1788 return false; 1789 }); 1790 1791 //accordion start open 1792 function accordionInit(){ 1793 $('.accordion').each(function(){ 1794 $(this).find('> .toggle').first().addClass('open').find('> div').show(); 1795 $(this).find('> .toggle').first().find('a i').attr('class','icon-minus-sign'); 1796 }); 1797 1798 1799 $('.toggles').each(function(){ 1800 1801 var $isAccordion = ($(this).hasClass('accordion')) ? true : false; 1802 1803 $(this).find('.toggle').each(function(){ 1804 if($(this).find('> div .testimonial_slider').length > 0 || $(this).find('> div iframe').length > 0) { 1805 var $that = $(this); 1806 $(this).find('> div').show().css({'opacity':0,'height':'1px', 'padding':'0'}); 1807 1808 testimonialHeightResize(); 1809 1810 setTimeout(function(){ 1811 $that.find('> div').hide().css({'opacity':1,'height':'auto', 'padding':'10px 14px'}); 1812 if($isAccordion == true && $that.index() == 0) $that.find('> div').slideDown(300); 1813 },900); 1814 } 1815 }); 1816 }) 1817 } 1818 accordionInit(); 1819 1820 //deep linking 1821 function accordionDeepLinking(){ 1822 if(typeof $_GET['toggle'] != 'undefined'){ 1823 $('.toggles').each(function(){ 1824 1825 $(this).find('.toggle').each(function(){ 1826 var $currentText = $(this).find('h3 a').clone(); 1827 var $getText = $_GET['toggle']; 1828 1829 $($currentText).find('i').remove(); 1830 $currentText = $currentText.text(); 1831 $currentText = $currentText.replace(/\s+/g, '-').toLowerCase(); 1832 $getText = $getText.replace(/\s+/g, '-').replace(/</g, '<').replace(/"/g, '"').toLowerCase(); 1833 1834 if($currentText == $getText) $(this).find('h3 a').click(); 1835 }); 1836 }); 1837 } 1838 } 1839 accordionDeepLinking(); 1840 1841/***************** Button ******************/ 1842 1843 $.cssHooks.color = { 1844 get: function(elem) { 1845 if (elem.currentStyle) 1846 var color = elem.currentStyle["color"]; 1847 else if (window.getComputedStyle) 1848 var color = document.defaultView.getComputedStyle(elem, 1849 null).getPropertyValue("color"); 1850 if (color.search("rgb") == -1) 1851 return color; 1852 else { 1853 color = color.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); 1854 function hex(x) { 1855 return ("0" + parseInt(x).toString(16)).slice(-2); 1856 } 1857 if(color) { 1858 return "#" + hex(color[1]) + hex(color[2]) + hex(color[3]); 1859 } 1860 } 1861 } 1862 } 1863 1864 $.cssHooks.backgroundColor = { 1865 get: function(elem) { 1866 if (elem.currentStyle) 1867 var bg = elem.currentStyle["backgroundColor"]; 1868 else if (window.getComputedStyle) 1869 var bg = document.defaultView.getComputedStyle(elem, 1870 null).getPropertyValue("background-color"); 1871 if (bg.search("rgb") == -1) 1872 return bg; 1873 else { 1874 bg = bg.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); 1875 function hex(x) { 1876 return ("0" + parseInt(x).toString(16)).slice(-2); 1877 } 1878 if(bg) { 1879 return "#" + hex(bg[1]) + hex(bg[2]) + hex(bg[3]);
1880 } 1881 } 1882 } 1883 } 1884 1885 function shadeColor(hex, lum) { 1886 1887 // validate hex string 1888 hex = String(hex).replace(/[^0-9a-f]/gi, ''); 1889 if (hex.length < 6) { 1890 hex = hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2]; 1891 } 1892 lum = lum || 0; 1893 1894 // convert to decimal and change luminosity 1895 var rgb = "#", c, i; 1896 for (i = 0; i < 3; i++) { 1897 c = parseInt(hex.substr(i*2,2), 16); 1898 c = Math.round(Math.min(Math.max(0, c + (c * lum)), 255)).toString(16); 1899 rgb += ("00"+c).substr(c.length); 1900 } 1901 1902 return rgb; 1903 } 1904 1905 //color 1906 function coloredButtons() { 1907 $('.nectar-button.see-through[data-color-override], .nectar-button.see-through-2[data-color-override], .nectar-button.see-through-3[data-color-override]').each(function(){ 1908 1909 $(this).css('visibility','visible'); 1910 1911 //if($(this).attr('data-color-override') != 'false'){ 1912 1913 if($(this).attr('data-color-override') != 'false') { 1914 var $color = $(this).attr('data-color-override') ; 1915 } else { 1916 if($(this).parents('.dark').length > 0) 1917 var $color = '#000000'; 1918 else 1919 var $color = '#ffffff'; 1920 } 1921 1922 if(!$(this).hasClass('see-through-3')) $(this).css('color',$color); 1923 $(this).find('i').css('color',$color); 1924 1925 var colorInt = parseInt($color.substring(1),16); 1926 var $hoverColor = ($(this).has('[data-hover-color-override]')) ? $(this).attr('data-hover-color-override') : 'no-override'; 1927 var $hoverTextColor = ($(this).has('[data-hover-text-color-override]')) ? $(this).attr('data-hover-text-color-override') : '#fff'; 1928 1929 var R = (colorInt & 0xFF0000) >> 16; 1930 var G = (colorInt & 0x00FF00) >> 8; 1931 var B = (colorInt & 0x0000FF) >> 0; 1932 1933 $opacityStr = ($(this).hasClass('see-through-3')) ? '1': '0.75'; 1934 1935 $(this).css('border-color','rgba('+R+','+G+','+B+','+$opacityStr+')'); 1936 1937 if($(this).hasClass('see-through')) { 1938 $(this).hover(function(){ 1939 $(this).css('border-color','rgba('+R+','+G+','+B+',1)'); 1940 },function(){ 1941 $(this).css('border-color','rgba('+R+','+G+','+B+','+$opacityStr+')'); 1942 }); 1943 } else { 1944 1945 $(this).find('i').css('color', $hoverTextColor); 1946 1947 if($hoverColor != 'no-override'){ 1948 $(this).hover(function(){ 1949 1950 $(this).css({ 1951 'border-color': $hoverColor, 1952 'background-color': $hoverColor, 1953 'color': $hoverTextColor 1954 }); 1955 },function(){ 1956 $opacityStr = ($(this).hasClass('see-through-3')) ? '1': '0.75'; 1957 1958 if(!$(this).hasClass('see-through-3')) { 1959 $(this).css({ 1960 'border-color':'rgba('+R+','+G+','+B+','+$opacityStr+')', 1961 'background-color': 'transparent', 1962 'color': $color 1963 });
1964 } else { 1965 $(this).css({ 1966 'border-color':'rgba('+R+','+G+','+B+','+$opacityStr+')', 1967 'background-color': 'transparent' 1968 }); 1969 } 1970 }); 1971 1972 } else { 1973 $(this).hover(function(){ 1974 $(this).css({ 1975 'border-color': $hoverColor, 1976 'color': $hoverTextColor 1977 }); 1978 },function(){ 1979 $opacityStr = ($(this).hasClass('see-through-3')) ? '1': '0.75'; 1980 $(this).css({ 1981 'border-color':'rgba('+R+','+G+','+B+','+$opacityStr+')', 1982 'color': $hoverTextColor 1983 }); 1984 }); 1985 1986 } 1987 // } 1988 1989 } 1990 }); 1991 1992 $('.nectar-button:not(.see-through):not(.see-through-2):not(.see-through-3)[data-color-override]').each(function(){ 1993 1994 $(this).css('visibility','visible'); 1995 1996 if($(this).attr('data-color-override') != 'false'){ 1997 1998 var $color = $(this).attr('data-color-override'); 1999 $(this).removeClass('accent-color').removeClass('extra-color-1').removeClass('extra-color-2').removeClass('extra-color-3'); 2000 $(this).css('background-color',$color); 2001 2002 } 2003 2004 }); 2005 2006 2007 //solid color tilt 2008 if($('.swiper-slide .solid_color_2').length > 0 || $('.tilt-button-inner').length > 0) { 2009 2010 var $tiltButtonCssString = ''; 2011 2012 $('.swiper-slide .solid_color_2 a').each(function(i){ 2013 2014 $(this).addClass('instance-'+i); 2015 2016 if($(this).attr('data-color-override') != 'false') { 2017 var $color = $(this).attr('data-color-override'); 2018 } else { 2019 if($(this).parents('.dark').length > 0) 2020 var $color = '#000000'; 2021 else 2022 var $color = '#ffffff'; 2023 } 2024 2025 $(this).css('color',$color); 2026 $(this).find('i').css('color',$color); 2027 2028 var $currentColor = $(this).css('background-color'); 2029 var $topColor = shadeColor($currentColor, 0.13); 2030 var $bottomColor = shadeColor($currentColor, -0.15); 2031 2032 $tiltButtonCssString += '.swiper-slide .solid_color_2 a.instance-'+i + ':after { background-color: '+$topColor+'; }' + ' .swiper-slide .solid_color_2 a.instance-'+i + ':before { background-color: '+$bottomColor+'; } '; 2033 2034 }); 2035 2036 2037 $('.tilt-button-wrap a').each(function(i){ 2038 2039 $(this).addClass('instance-'+i); 2040 2041 var $currentColor = $(this).css('background-color'); 2042 2043 if($(this).attr('data-color-override') != 'false') { 2044 var $color = $(this).attr('data-color-override'); 2045 $(this).css('background-color',$color); 2046 $currentColor = $color; 2047 } 2048 2049 var $topColor = shadeColor($currentColor, 0.13); 2050 var $bottomColor = shadeColor($currentColor, -0.15); 2051 2052 $tiltButtonCssString += '.tilt-button-wrap a.instance-'+i + ':after { background-color: '+$topColor+'; }' + ' .tilt-button-wrap a.instance-'+i + ':before { background-color: '+$bottomColor+'; } '; 2053 2054 }); 2055 2056 var head = document.head || document.getElementsByTagName('head')[0]; 2057 var style = document.createElement('style'); 2058 2059 style.type = 'text/css'; 2060 if (style.styleSheet){ 2061 style.styleSheet.cssText = $tiltButtonCssString; 2062 } else { 2063 style.appendChild(document.createTextNode($tiltButtonCssString)); 2064 } 2065 2066 head.appendChild(style); 2067 } 2068 2069 } 2070 2071 coloredButtons(); 2072 2073 2074 //large icon hover 2075 function largeIconHover(){ 2076 $('.icon-3x').each(function(){ 2077 $(this).closest('.col').hover(function(){ 2078 $(this).find('.icon-3x').addClass('hovered') 2079 },function(){ 2080 $('.icon-3x').removeClass('hovered') 2081 }); 2082 }); 2083 } 2084 largeIconHover(); 2085 2086 2087 2088/***************** Column Hover BG ******************/ 2089 2090function columnBGColors() { 2091 2092 var $columnColorCSS = ''; 2093 2094 $('.wpb_column').each(function(i){ 2095 2096 $(this).addClass('instance-'+i); 2097 2098 //bg color 2099 if($(this).attr('data-has-bg-color') == 'true') { 2100 if($(this).is('[data-animation*="reveal"]') && $(this).hasClass('has-animation')) 2101 $columnColorCSS += '.wpb_column.instance-'+i+ ' .column-inner-wrap .column-inner:before { background-color:' + $(this).attr('data-bg-color') + '; opacity: '+$(this).attr('data-bg-opacity')+'; }'; 2102 else 2103 $columnColorCSS += '.wpb_column.instance-'+i+ ':before { background-color:' + $(this).attr('data-bg-color') + '; opacity: '+$(this).attr('data-bg-opacity')+'; }'; 2104 } 2105 2106 //hover bg color 2107 if($(this).is('[data-hover-bg^="#"]')) { 2108 if($(this).is('[data-animation*="reveal"]') && $(this).hasClass('has-animation')) 2109 $columnColorCSS += '.wpb_column.instance-'+i+ ':hover .column-inner:before { background-color: '+$(this).attr('data-hover-bg') + '; opacity: '+$(this).attr('data-hover-bg-opacity')+'; }'; 2110 else 2111 $columnColorCSS += '.wpb_column.instance-'+i+ ':hover:before { background-color: '+$(this).attr('data-hover-bg') + '; opacity: '+$(this).attr('data-hover-bg-opacity')+'; }'; 2112 2113 } 2114 }); 2115 2116 if($columnColorCSS.length > 1) { 2117 var head = document.head || document.getElementsByTagName('head')[0]; 2118 var style = document.createElement('style'); 2119 2120 style.type = 'text/css'; 2121 if (style.styleSheet){ 2122 style.styleSheet.cssText = $columnColorCSS; 2123 } else { 2124 style.appendChild(document.createTextNode($columnColorCSS)); 2125 } 2126 2127 head.appendChild(style); 2128 } 2129 2130} 2131columnBGColors(); 2132 2133 2134 2135/***************** Row Color Overlay ******************/ 2136function rowColorOverlay() { 2137 2138 var $rowOverlayCSS = ''; 2139 2140 $('.row > .wpb_row > .row-bg-wrap > .row-bg[data-color_overlay], #portfolio-extra > .wpb_row > .row-bg-wrap > .row-bg[data-color_overlay], .single #post-area .content-inner > .wpb_row > .row-bg-wrap > .row-bg[data-color_overlay]').each(function(i){ 2141 2142 $(this).parent().addClass('instance-'+i); 2143 2144 $overlayOpacity = ($(this).attr('data-overlay_strength').length > 0) ? $(this).attr('data-overlay_strength') : '1'; 2145 $overlay1 = ($(this).attr('data-color_overlay').length > 0) ? $(this).attr('data-color_overlay') : 'transparent'; 2146 $overlay2 = ($(this).attr('data-color_overlay_2').length > 0) ? $(this).attr('data-color_overlay_2') : 'transparent'; 2147 $gradientDirection = ($(this).attr('data-gradient_direction').length > 0) ? $(this).attr('data-gradient_direction') : 'left_t_right'; 2148 switch($gradientDirection) { 2149 case 'left_to_right' : 2150 var $gradientDirectionDeg = '90deg'; 2151 break; 2152 case 'left_t_to_right_b' : 2153 var $gradientDirectionDeg = '135deg'; 2154 break; 2155 case 'left_b_to_right_t' : 2156 var $gradientDirectionDeg = '45deg'; 2157 break; 2158 case 'top_to_bottom' : 2159 var $gradientDirectionDeg = 'to bottom'; 2160 break; 2161 } 2162 $enableGradient = ($(this).attr('data-enable_gradient') == 'true') ? true : false; 2163 2164 if($enableGradient) { 2165 2166 //safari transparent white fix 2167 if($overlay1 == '#ffffff' && $overlay2 == 'transparent') $overlay2 = 'rgba(255,255,255,0.001)'; 2168 if($overlay1 == 'transparent' && $overlay2 == '#ffffff') $overlay1 = 'rgba(255,255,255,0.001)'; 2169 2170 if($gradientDirection == 'top_to_bottom') { 2171 if($overlay2 == 'transparent' || $overlay2 == 'rgba(255,255,255,0.001)') $rowOverlayCSS += '.row-bg-wrap.instance-'+i+ ':after { background: linear-gradient('+$gradientDirectionDeg+',' + $overlay1 + ' 0%,' + $overlay2 + ' 75%); opacity: '+$overlayOpacity+'; }'; 2172 if($overlay1 == 'transparent' || $overlay1 == 'rgba(255,255,255,0.001)') $rowOverlayCSS += '.row-bg-wrap.instance-'+i+ ':after { background: linear-gradient('+$gradientDirectionDeg+',' + $overlay1 + ' 25%,' + $overlay2 + ' 100%); opacity: '+$overlayOpacity+'; }'; 2173 2174 if( $overlay1 != 'transparent' && $overlay2 != 'transparent') $rowOverlayCSS += '.row-bg-wrap.instance-'+i+ ':after { background: '+$overlay1+'; background: linear-gradient('+$gradientDirectionDeg+',' + $overlay1 + ' 0%,' + $overlay2 + ' 100%); opacity: '+$overlayOpacity+'; }'; 2175 2176 } else 2177 $rowOverlayCSS += '.row-bg-wrap.instance-'+i+ ':after { background: '+$overlay1+'; background: linear-gradient('+$gradientDirectionDeg+',' + $overlay1 + ' 0%,' + $overlay2 + ' 100%); opacity: '+$overlayOpacity+'; }'; 2178 2179 2180 } else { 2181 2182 if($(this).attr('data-color_overlay').length > 0) { 2183 $rowOverlayCSS += '.row-bg-wrap.instance-'+i+ ':after { background-color:' + $overlay1 + '; opacity: '+$overlayOpacity+'; }'; 2184 } 2185 2186 } 2187 2188 2189 2190 }); 2191 2192 if($rowOverlayCSS.length > 1) { 2193 var head = document.head || document.getElementsByTagName('head')[0]; 2194 var style = document.createElement('style'); 2195 2196 style.type = 'text/css'; 2197 if (style.styleSheet){ 2198 style.styleSheet.cssText = $rowOverlayCSS; 2199 } else { 2200 style.appendChild(document.createTextNode($rowOverlayCSS)); 2201 } 2202 2203 head.appendChild(style); 2204 } 2205 2206} 2207 2208rowColorOverlay(); 2209 2210 2211/***************** morphing button ******************/ 2212 2213function morphingOutlines() { 2214 2215 if($('.morphing-outline').length > 0) { 2216 2217 $morphingOutlineCSS = ''; 2218 2219 $('.morphing-outline').each(function(i){ 2220 $(this).addClass('instance-'+i).css({'visibility':'visible'}); 2221 var $width = $(this).find('.inner').width(); 2222 var $height = $(this).find('.inner').height(); 2223 var $border = parseInt($(this).attr("data-border-thickness")); 2224 var $hover = ($('body[data-button-style="rounded"]').length > 0) ? ':hover': ''; 2225 var $hover2 = ($('body[data-button-style="rounded"]').length > 0) ? '': ':hover'; 2226 2227 $morphingOutlineCSS += 'body .morphing-outline.instance-'+i+' .inner > * { color: '+$(this).attr("data-starting-color")+'; } '; 2228 $morphingOutlineCSS += 'body .morphing-outline.instance-'+i+' .inner:after { border-width:'+$(this).attr("data-border-thickness")+'px ; border-color: '+$(this).attr("data-starting-color")+'; } '; 2229 2230 $morphingOutlineCSS += 'body .wpb_column:hover > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner > * { color: '+$(this).attr("data-hover-color")+'; } '; 2231 $morphingOutlineCSS += 'body .wpb_column:hover > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { border-color: '+$(this).attr("data-hover-color")+'; } ';
2232 //padding calcs 2233 $morphingOutlineCSS += 'body .wpb_column'+$hover2+' > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { padding: '+(($width+100 + $border*2 - $height)/2 - $border) +'px 50px}'; 2234 $morphingOutlineCSS += '.morphing-outline.instance-'+i+' { padding: '+(30+($width+80 + $border*2 - $height)/2 - $border) +'px 50px}'; //extra space on the outer for mobile/close elements 2235 $morphingOutlineCSS += 'body .wpb_column'+$hover2+' > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { top: -'+ parseInt((($width+100 + $border*2 - $height)/2 - $border) + $border)+ 'px }'; 2236 2237 $morphingOutlineCSS += 'body .wpb_column > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { left: -' + parseInt(50+$border) + 'px }'; 2238 ////hover 2239 $morphingOutlineCSS += 'body .wpb_column'+$hover+' > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { padding: 50px 50px}'; 2240 $morphingOutlineCSS += 'body .wpb_column'+$hover+' > .wpb_wrapper > .morphing-outline.instance-'+i+' .inner:after { top: -'+parseInt(50+$border) +'px }'; 2241 2242 }); 2243 2244 var head = document.head || document.getElementsByTagName('head')[0]; 2245 var style = document.createElement('style'); 2246 2247 style.type = 'text/css'; 2248 style.id = 'morphing-outlines'; 2249 if (style.styleSheet){ 2250 style.styleSheet.cssText = $morphingOutlineCSS; 2251 } else { 2252 style.appendChild(document.createTextNode($morphingOutlineCSS)); 2253 } 2254 2255 $('#morphing-outlines').remove(); 2256 head.appendChild(style); 2257 } 2258} 2259 2260setTimeout(morphingOutlines,100); 2261setTimeout(fullWidthContentColumns,126); 2262 2263 2264/***************** svg icons *******************/ 2265 2266function svgAnimations() { 2267 var $icon = []; 2268 2269 $('.svg-icon-holder').each(function(i){ 2270 var $that = $(this); 2271 2272 if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)) $that.attr('data-animation','false'); 2273 2274 //size 2275 $that.css({'height': parseInt($that.attr('data-size')) +'px', 'width': parseInt($that.attr('data-size')) +'px'}); 2276 2277 //animation 2278 $(this).attr('id','nectar-svg-animation-instance-'+i); 2279 var $animationSpeed = ($that.is('[data-animation-speed]') && $that.attr('data-animation-speed').length > 0) ? $that.attr('data-animation-speed') : 200; 2280 if($that.attr('data-animation') == 'false') { 2281 $animationSpeed = 1; 2282 $that.css('opacity','1'); 2283 } 2284 2285 $icon[i] = new Vivus($that.attr('id'), {type: 'delayed', pathTimingFunction: Vivus.EASE_OUT, animTimingFunction: Vivus.LINEAR, duration: $animationSpeed, file: $that.text(), onReady: svgInit }); 2286 $that.find('span').remove(); 2287 if($animationSpeed !== 1) { 2288 2289 var $that = $(this); 2290 var waypoint = new Waypoint({ 2291 element: $that, 2292 handler: function(direction) { 2293 if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 2294 waypoint.destroy(); 2295 return; 2296 } 2297 2298 checkIfReady(); 2299 $that.addClass('animated-in'); 2300 waypoint.destroy(); 2301 }, 2302 offset: 'bottom-in-view' 2303 2304 }); 2305 2306 } else { 2307 checkIfReady(); 2308 } 2309 2310 function checkIfReady() { 2311 var $animationDelay = ($that.is('[data-animation-delay]') && $that.attr('data-animation-delay').length > 0 && $that.attr('data-animation') != 'false') ? $that.attr('data-animation-delay') : 0; 2312 if($icon[$that.attr('id').slice(-1)].isReady == true) { 2313 $that.css('opacity','1'); 2314 setTimeout(function(){ $icon[$that.attr('id').slice(-1)].reset().play(); },$animationDelay); 2315 } else { 2316 setTimeout(checkIfReady,50); 2317 } 2318 } 2319 2320 function svgInit() { 2321 2322 //set size 2323 $that.find('object').css({'height': parseInt($that.attr('data-size')) +'px', 'width': parseInt($that.attr('data-size')) +'px'}); 2324 2325 //stop animation until user scrolls to it 2326 $icon[$that.attr('id').slice(-1)].reset().stop(); 2327 2328 //set color 2329 var svgDoc = $that.find('object')[0].contentDocument; 2330 2331 var styleElement = svgDoc.createElementNS("http://www.w3.org/2000/svg", "style"); 2332 styleElement.textContent = "svg, svg path { stroke: "+$that.css('color')+" }"; 2333 svgDoc.getElementById("Layer_1").appendChild(styleElement); 2334 2335 } 2336 2337 }); 2338} 2339if($('.nectar-box-roll').length == 0 || $('body.mobile').length > 0) setTimeout(svgAnimations,100); 2340 2341/***************** fancy ul ******************/ 2342 function nectar_fancy_ul_init() { 2343 $('.nectar-fancy-ul').each(function(){ 2344 2345 2346 var $icon = $(this).attr('data-list-icon'); 2347 var $color = $(this).attr('data-color'); 2348 var $animation = $(this).attr('data-animation'); 2349 2350 if($(this).find('li i').length == 0) 2351 $(this).find('li').prepend('<i class="icon-default-style '+$icon+ ' ' + $color +'"></i> '); 2352 2353 if($animation == 'true') { 2354 2355 2356 var $that = $(this); 2357 var waypoint = new Waypoint({ 2358 element: $that, 2359 handler: function(direction) { 2360 2361 if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 2362 waypoint.destroy(); 2363 return; 2364 } 2365 2366 $that.find('li').each(function(i){ 2367 var $that = $(this); 2368 $that.delay(i*220).transition({ 2369 'opacity': '1', 2370 'left' : '0' 2371 },220,'easeOutCubic'); 2372 });
2373 2374 $that.addClass('animated-in'); 2375 waypoint.destroy(); 2376 }, 2377 offset: 'bottom-in-view' 2378 2379 }); 2380 2381 } 2382 2383 2384 2385 }); 2386 } 2387 setTimeout(function(){ 2388 if($('.nectar-box-roll').length == 0) nectar_fancy_ul_init(); 2389 },$animationOnScrollTimeOut); 2390 2391 2392 2393/***************** PARALLAX SECTIONS ******************/ 2394 2395 // Create cross browser requestAnimationFrame method: 2396 window.requestAnimationFrame = window.requestAnimationFrame 2397 || window.mozRequestAnimationFrame 2398 || window.webkitRequestAnimationFrame 2399 || window.msRequestAnimationFrame 2400 || function(f){setTimeout(f, 1000/60)} 2401 2402 2403 var $window = $(window); 2404 var windowHeight = $window.height(); 2405 2406 $window.unbind('scroll.parallaxSections').unbind('resize.parallaxSections'); 2407 $window.unbind('resize.parallaxSectionsUpdateHeight'); 2408 $window.unbind('load.parallaxSectionsOffsetL'); 2409 $window.unbind('resize.parallaxSectionsOffsetR'); 2410 2411 $window.on('resize.parallaxSectionsUpdateHeight',psUpdateWindowHeight); 2412 2413 function psUpdateWindowHeight() { 2414 windowHeight = $window.height(); 2415 } 2416 2417 function psUpdateOffset($this) { 2418 $this.each(function(){ 2419 firstTop = $this.offset().top; 2420 }); 2421 } 2422 2423 $.fn.parallaxScroll = function(xpos, speedFactor, outerHeight) { 2424 var $this = $(this); 2425 var getHeight; 2426 var firstTop; 2427 var paddingTop = 0; 2428 2429 //get the starting position of each element to have parallax applied to it 2430 $this.each(function(){ 2431 firstTop = $this.offset().top; 2432 }); 2433 2434 2435 $window.on('resize.parallaxSectionsOffsetR',psUpdateOffset($this)); 2436 $window.on('load.parallaxSectionsOffsetL',psUpdateOffset($this)); 2437 2438 getHeight = function(jqo) { 2439 return jqo.outerHeight(true); 2440 }; 2441 2442 2443 // setup defaults if arguments aren't specified 2444 if (arguments.length < 1 || xpos === null) xpos = "50%"; 2445 if (arguments.length < 2 || speedFactor === null) speedFactor = 0.1; 2446 if (arguments.length < 3 || outerHeight === null) outerHeight = true; 2447 2448 // function to be called whenever the window is scrolled or resized 2449 2450 var $element, top, height, pos; 2451 2452 function update(){ 2453 2454 pos = $window.scrollTop(); 2455 2456 $this.each(function(){ 2457 2458 firstTop = $this.offset().top; 2459 2460 $element = $(this); 2461 top = $element.offset().top; 2462 height = getHeight($element); 2463 2464 // Check if totally above or totally below viewport 2465 if (top + height < pos || top > pos + windowHeight) { 2466 return; 2467 } 2468 2469 var ua = window.navigator.userAgent; 2470 var msie = ua.indexOf("MSIE "); 2471 2472 //for IE, Safari or any setup using the styled scrollbar default to animating the BG pos 2473 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./) || $smoothCache == true || navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { 2474 $this.find('.row-bg.using-image').css('backgroundPosition', xpos + " " + Math.round((firstTop - pos) * speedFactor) + "px"); 2475 } 2476 //for Firefox/Chrome use a higher performing method 2477 else { 2478 var $ifFast = ($this.find('.row-bg[data-parallax-speed="fast"]').length > 0) ? ($element.find('.row-bg').height() - height)/2 : 0; 2479 $this.find('.row-bg.using-image').addClass('translate').css({ 'transform': 'translate3d(0, ' + Math.round(((window.innerHeight + pos - firstTop) * speedFactor) -($ifFast)) + 'px, 0), scale(1.005)' }); 2480 } 2481 2482 }); 2483 } 2484 2485 if (window.addEventListener) { 2486 window.addEventListener('scroll', function(){ 2487 requestAnimationFrame(update); 2488 }, false); 2489 } 2490 2491 $window.on('resize.parallaxSections',update); 2492 2493 update(); 2494 }; 2495 2496 2497 2498 2499/***************** Full Width Section ******************/ 2500 function fullWidthSections(){ 2501 2502 var $scrollBar = ($('#ascrail2000').length > 0 && window.innerWidth > 1000) ? -13 : 4; 2503 2504 if($('#boxed').length == 1){ 2505 $justOutOfSight = ((parseInt($('.container-wrap').width()) - parseInt($('.main-content').width())) / 2) + 4; 2506 } else { 2507 2508 //if the ext responsive mode is on - add the extra padding into the calcs 2509 var $extResponsivePadding = ($('body[data-ext-responsive="true"]').length > 0 && window.innerWidth >= 1000) ? 180 : 0; 2510 2511 if($(window).width() <= parseInt($('.main-content').css('max-width'))) { 2512 var $windowWidth = parseInt($('.main-content').css('max-width')); 2513 2514 //no need for the scrollbar calcs with ext responsive on desktop views 2515 if($extResponsivePadding == 180) $windowWidth = $windowWidth - $scrollBar; 2516 2517 } else { 2518 var $windowWidth = $(window).width(); 2519 } 2520 2521 2522 $contentWidth = parseInt($('.main-content').css('max-width')); 2523 2524 //single post fullwidth 2525 if($('body.single-post[data-ext-responsive="true"]').length > 0 && $('.container-wrap.no-sidebar').length > 0 ) { 2526 $contentWidth = $('#post-area').width(); 2527 $extResponsivePadding = 0; 2528 } 2529
2530 $justOutOfSight = Math.ceil( (($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2) ) 2531 } 2532 2533 $('.full-width-section').each(function(){ 2534 2535 if(!$(this).parents('.span_9').length > 0 && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner' && $(this).parent().attr('id') != 'portfolio-extra' && 2536 !$(this).hasClass('non-fw')){ 2537 2538 $(this).css({ 2539 'margin-left': - $justOutOfSight, 2540 'padding-left': $justOutOfSight, 2541 'padding-right': $justOutOfSight, 2542 'visibility': 'visible' 2543 }); 2544 } else if($(this).parent().attr('id') == 'portfolio-extra' && $('#full_width_portfolio').length != 0) { 2545 $(this).css({ 2546 'margin-left': - $justOutOfSight, 2547 'padding-left': $justOutOfSight, 2548 'padding-right': $justOutOfSight, 2549 'visibility': 'visible' 2550 }); 2551 } 2552 2553 else { 2554 $(this).css({ 2555 'margin-left': 0, 2556 'padding-left': 0, 2557 'padding-right': 0, 2558 'visibility': 'visible' 2559 }); 2560 } 2561 2562 }); 2563 2564 2565 //full width content sections 2566 $('.carousel-outer').has('.carousel-wrap[data-full-width="true"]').css('overflow','visible'); 2567 2568 $('.carousel-wrap[data-full-width="true"], .portfolio-items[data-col-num="elastic"], .full-width-content').each(function(){ 2569 2570 //single post fullwidth 2571 if($('#boxed').length == 1){ 2572 if($('body.single-post[data-ext-responsive="true"]').length > 0 && $('.container-wrap.no-sidebar').length > 0 && $(this).parents('#post-area').length > 0) { 2573 $contentWidth = $('#post-area').width(); 2574 $extResponsivePadding = 0; 2575 $windowWidth = $(window).width(); 2576 $justOutOfSight = Math.ceil( (($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2) ) 2577 } else { 2578 $justOutOfSight = ((parseInt($('.container-wrap').width()) - parseInt($('.main-content').width())) / 2) + 4; 2579 } 2580 } else { 2581 if($('body.single-post[data-ext-responsive="true"]').length > 0 && $('.container-wrap.no-sidebar').length > 0 && $(this).parents('#post-area').length > 0) { 2582 $contentWidth = $('#post-area').width(); 2583 $extResponsivePadding = 0; 2584 $windowWidth = $(window).width(); 2585 } else { 2586 2587 if($(window).width() <= parseInt($('.main-content').css('max-width'))) { 2588 $windowWidth = parseInt($('.main-content').css('max-width')); 2589 //no need for the scrollbar calcs with ext responsive on desktop views 2590 if($extResponsivePadding == 180) $windowWidth = $windowWidth - $scrollBar; 2591 } 2592 $contentWidth = parseInt($('.main-content').css('max-width')); 2593 $extResponsivePadding = ($('body[data-ext-responsive="true"]').length > 0 && window.innerWidth >= 1000) ? 180 : 0; 2594 } 2595 $justOutOfSight = Math.ceil( (($windowWidth + $extResponsivePadding + $scrollBar - $contentWidth) / 2) ) 2596 } 2597 2598 $extraSpace = ($(this).hasClass('carousel-wrap')) ? 1 : 4; 2599 $carouselWidth = ($('#boxed').length == 1) ? parseInt($('.main-content').width()) + parseInt($justOutOfSight*2) : $(window).width() +$extraSpace + $scrollBar ; 2600 2601 if($(this).parent().hasClass('default-style')) { 2602 2603 if($('#boxed').length != 0) { 2604 $carouselWidth = ($('#boxed').length == 1) ? parseInt($('.main-content').width()) + parseInt($justOutOfSight*2) : $(window).width() + $extraSpace + $scrollBar ; 2605 } 2606 else { 2607 $carouselWidth = ($('#boxed').length == 1) ? parseInt($('.main-content').width()) + parseInt($justOutOfSight*2) : $(window).width() - ($(window).width()*.025) + $extraSpace + $scrollBar ; 2608 $windowWidth = ($(window).width() <= parseInt($('.main-content').width())) ? parseInt($('.main-content').width()) : $(window).width() - ($(window).width()*.025); 2609 $justOutOfSight = Math.ceil( (($windowWidth + $scrollBar - parseInt($('.main-content').width())) / 2) ) 2610 } 2611 } 2612 2613 else if($(this).parent().hasClass('spaced')) { 2614 2615 if($('#boxed').length != 0) { 2616 $carouselWidth = ($('#boxed').length == 1) ? parseInt($('.main-content').width()) + parseInt($justOutOfSight*2) - ($(window).width()*.02) : $(window).width() + $extraSpace + $scrollBar ; 2617 } else { 2618 $carouselWidth = ($('#boxed').length == 1) ? parseInt($('.main-content').width()) + parseInt($justOutOfSight*2) : $(window).width() - Math.
2618ceil($(window).width()*.02) + $extraSpace + $scrollBar ; 2619 var $windowWidth2 = ($(window).width() <= parseInt($('.main-content').width())) ? parseInt($('.main-content').width()) : $(window).width() - ($(window).width()*.02); 2620 $justOutOfSight = Math.ceil( (($windowWidth2 + $scrollBar - parseInt($('.main-content').width())) / 2) +2) 2621 } 2622 } 2623 2624 if(!$(this).parents('.span_9').length > 0 && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner' && $(this).parent().attr('id') != 'portfolio-extra' 2625 && !$(this).find('.carousel-wrap[data-full-width="true"]').length > 0 2626 && !$(this).find('.portfolio-items:not(".carousel")[data-col-num="elastic"]').length > 0){ 2627 2628 //escape if inside woocoommerce page and not using applicable layout 2629 if($('.single-product').length > 0 && $(this).parents('#tab-description').length > 0 && $(this).parents('.full-width-tabs').length == 0) { 2630 $(this).css({ 2631 'visibility': 'visible' 2632 }); 2633 } else { 2634 if($(this).hasClass('portfolio-items')) { 2635 $(this).css({ 2636 'transform': 'translateX(-'+ $justOutOfSight + 'px)', 2637 'margin-left': 0, 2638 'width': $carouselWidth, 2639 'visibility': 'visible' 2640 }); 2641 } else { 2642 $(this).css({ 2643 'margin-left': - $justOutOfSight, 2644 'width': $carouselWidth, 2645 'visibility': 'visible' 2646 }); 2647 } 2648 2649 } 2650 } else if($(this).parent().attr('id') == 'portfolio-extra' && $('#full_width_portfolio').length != 0) { 2651 $(this).css({ 2652 'margin-left': - $justOutOfSight, 2653 'width': $carouselWidth, 2654 'visibility': 'visible' 2655 }); 2656 } 2657 2658 else { 2659 $(this).css({ 2660 'margin-left': 0, 2661 'visibility': 'visible' 2662 }); 2663 } 2664 2665 }); 2666 2667 } 2668 2669 var $contentElementsNum = ($('#portfolio-extra').length == 0) ? $('.main-content > .row > *').length : $('.main-content > .row #portfolio-extra > *').length ; 2670 2671 function parallaxSrollSpeed(speedString) { 2672 2673 var ua = window.navigator.userAgent; 2674 var msie = ua.indexOf("MSIE "); 2675 var speed; 2676 2677 //not as modern browsers 2678 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./) || $smoothCache == true || navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { 2679 switch(speedString) { 2680 case 'slow': 2681 speed = 0.2; 2682 break; 2683 case 'medium': 2684 speed = 0.4; 2685 break; 2686 case 'fast': 2687 speed = 0.6; 2688 break; 2689 } 2690 } 2691 //chrome/ff 2692 else { 2693 switch(speedString) { 2694 case 'slow': 2695 speed = 0.6; 2696 break; 2697 case 'medium': 2698 speed = 0.4; 2699 break; 2700 case 'fast': 2701 speed = 0.25; 2702 break; 2703 } 2704 } 2705 2706 return speed; 2707 } 2708 2709 function parallaxScrollInit(){ 2710 parallaxRowsBGCals(); 2711 $('.full-width-section.parallax_section, .full-width-content.parallax_section').each(function(){ 2712 var $id = $(this).attr('id'); 2713 2714 var ua = window.navigator.userAgent; 2715 var msie = ua.indexOf("MSIE "); 2716 2717 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./) || $smoothCache == true || navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { 2718 if($(this).find('[data-parallax-speed="fixed"]').length == 0) $('#'+$id + ".parallax_section").parallaxScroll("50%", parallaxSrollSpeed($(this).find('.row-bg').attr('data-parallax-speed')) ); 2719 } else if($(this).find('[data-parallax-speed="fixed"]').length == 0) { 2720 $('#'+$id + ".parallax_section").parallaxScroll("50%", parallaxSrollSpeed($(this).find('.row-bg').attr('data-parallax-speed')) ); 2721 } 2722 }); 2723 } 2724 2725 2726 if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)){ 2727 parallaxScrollInit(); 2728 $(window).load(parallaxRowsBGCals); 2729 } 2730 2731 function parallaxRowsBGCals(){ 2732 $('.full-width-section.parallax_section, .full-width-content.parallax_section').each(function(){ 2733 2734 var ua = window.navigator.userAgent; 2735 var msie = ua.indexOf("MSIE "); 2736 2737 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./) || $smoothCache == true || navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { 2738 $(this).find('.row-bg').css({'height': $(this).outerHeight(true)*2.8, 'margin-top': '-' + ($(this).outerHeight(true)*2.8)/2 + 'px' }); 2739 } else { 2740 $(this).find('.row-bg').css({'height': Math.ceil( $(window).height() * parallaxSrollSpeed($(this).find('.row-bg').attr('data-parallax-speed')) ) + $(this).outerHeight(true) }); 2741 } 2742 2743 }); 2744 } 2745 2746 //if fullwidth section is first or last, remove the margins so it fits flush against header/footer 2747 function fwsClasses() { 2748 2749 $('.wpb_wrapper > .nectar-slider-wrap[data-full-width="true"]').each(function(){ 2750 if(!$(this).parent().hasClass('span_9') && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner'){ 2751 if($(this).parents('.wpb_row').index() == '0'){ 2752 $(this).addClass('first-nectar-slider'); 2753 } 2754 } 2755 }); 2756 2757 $contentElementsNum = ($('#portfolio-extra').length == 0) ? $('.main-content > .row > *').length : $('.main-content > .row #portfolio-extra > *').length ; 2758 2759 $('.full-width-section, .full-width-content:not(.page-submenu .full-width-content), .row > .nectar-slider-wrap[data-full-width="true"], .wpb_wrapper > .nectar-slider-wrap[data-full-width="true"], .parallax_slider_outer, .portfolio-items[data-col-num="elastic"]').each(function(){ 2760 2761 if(!$(this).parent().hasClass('span_9') && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner'){ 2762 2763 if($(this).parents('.wpb_row').length > 0){ 2764 2765 if($(this).parents('#portfolio-extra').length > 0 && $('#full_width_portfolio').length == 0) return false; 2766 2767 ////first 2768 if($(this).parents('.wpb_row').index() == '0' && $('#page-header-bg').length != 0 || $(this).parents('.wpb_row').index() == '0' && $('.parallax_slider_outer').length != 0){ 2769 //$(this).css('margin-top','-2.1em').addClass('first-section nder-page-header'); 2770 } 2771 else if($(this).parents('.wpb_row').index() == '0' && $('#page-header-bg').length == 0 && $('.page-header-no-bg').length == 0
2772 && $('.project-title').length == 0 && $(this).parents('.wpb_row').index() == '0' 2773 && $('.parallax_slider_outer').length == 0 && $('.project-title').length == 0 2774 && $('body[data-bg-header="true"]').length == 0) { 2775 2776 if($('body[data-header-resize="0"]').length == 1 && $('.single').length == 0) { 2777 $('.container-wrap').css('padding-top','0px'); 2778 } else { 2779 $(this).css('margin-top','-70px').addClass('first-section'); 2780 } 2781 2782 } 2783 2784 //check if it's also last (i.e. the only fws) 2785 if($(this).parents('.wpb_row').index() == $contentElementsNum-1 && $('#respond').length == 0 ) { 2786 if($(this).attr('id') != 'portfolio-filters-inline') { 2787 $('.container-wrap').css('padding-bottom','0px'); 2788 $('#call-to-action .triangle').remove(); 2789 } 2790 } 2791 2792 } else { 2793 2794 if($(this).parents('#portfolio-extra').length > 0 && $('#full_width_portfolio').length == 0) return false; 2795 2796 if( $(this).find('.portfolio-filters-inline').length == 0 && $(this).attr('id') != 'post-area' ) { 2797 2798 ////first 2799 if($(this).index() == '0' && $('#page-header-bg').length != 0 || $(this).index() == '0' && $('.parallax_slider_outer').length != 0){ 2800 //$(this).css('margin-top','-2.1em').addClass('first-section nder-page-header'); 2801 2802 } 2803 else if($(this).index() == '0' && $('#page-header-bg').length == 0 && $(this).index() == '0' && $('.page-header-no-bg').length == 0 && 2804 $(this).index() == '0' && $('.parallax_slider_outer').length == 0 && !$(this).hasClass('blog_next_prev_buttons') ) { 2805 2806 if($('body[data-header-resize="0"]').length == 1 && $('.single').length == 0) { 2807 $('.container-wrap').css('padding-top','0px'); 2808 } else { 2809 $(this).css('margin-top','-70px').addClass('first-section'); 2810 } 2811 2812 } 2813 2814 //check if it's also last (i.e. the only fws) 2815 if($(this).index() == $contentElementsNum-1 && $('#respond').length == 0 ) { 2816 $('.container-wrap').css('padding-bottom','0px'); 2817 $('.bottom_controls').css('margin-top','0px'); 2818 $('#call-to-action .triangle').remove(); 2819 } 2820 } 2821 2822 } 2823 } 2824 }); 2825 2826 2827 //add first class for rows for page header trans effect (zoom only as of now) 2828 $('.full-width-section.wpb_row, .full-width-content.wpb_row').each(function(){ 2829 2830 if(!$(this).parent().hasClass('span_9') && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner'){ 2831 2832 2833 if($(this).parents('#portfolio-extra').length > 0 && $('#full_width_portfolio').length == 0) return false; 2834 2835 if($(this).index() == '0' && $('#page-header-bg').length == 0 && $('.page-header-no-bg').length == 0 2836 && $('.project-title').length == 0 && $('body.single').length == 0 2837 && $('.parallax_slider_outer').length == 0 && $('.project-title').length == 0 ) { 2838 2839 $(this).addClass('first-section'); 2840 var $that = $(this); 2841 setTimeout( function() { $that.addClass('loaded'); },50); 2842 2843 } 2844 2845 2846 } 2847 }); 2848 2849 2850 2851 $('#portfolio-extra > .nectar-slider-wrap[data-full-width="true"], .portfolio-wrap').each(function(){ 2852 //check if it's last 2853 if($(this).index() == $contentElementsNum-1 && $('#commentform').length == 0 && $('#pagination').length == 0) { 2854 $(this).css('margin-bottom','-40px'); 2855 $('#call-to-action .triangle').remove(); 2856 } 2857 }); 2858 2859 2860 2861 $('.portfolio-filters').each(function(){ 2862 ////first 2863 if($(this).index() == '0' && $('#page-header-bg').length != 0 || $(this).index() == '0' && $('.parallax_slider_outer').length != 0){ 2864 $(this).css({'margin-top':'-2.1em'}).addClass('first-section nder-page-header'); 2865 } else if($(this).index() == '0' && $('#page-header-bg').length == 0 || $(this).index() == '0' && $('.parallax_slider_outer').length == 0){ 2866 $(this).css({'margin-top':'0px'}).addClass('first-section'); 2867 } 2868 }); 2869 2870 $('.portfolio-filters-inline').each(function(){ 2871 ////first 2872 if($(this).parents('.wpb_row').length > 0){ 2873 2874 if($(this).parents('.wpb_row').index() == '0' && $('#page-header-bg').length != 0 || $(this).parents('.wpb_row').index() == '0' && $('.parallax_slider_outer').length != 0){ 2875 if($('body[data-header-resize="0"]').length == 0) $(this).css({'margin-top':'-2.1em', 'padding-top' : '19px'}).addClass('first-section nder-page-header'); 2876 } else if($(this).parents('.wpb_row').index() == '0' && $('#page-header-bg').length == 0 || $(this).parents('.wpb_row').index() == '0' && $('.parallax_slider_outer').length == 0){ 2877 2878 if($('body[data-header-resize="0"]').length == 1) { 2879 // $(this).css({'margin-top':'-30px', 'padding-top' : '50px'}).addClass('first-section'); 2880 } else { 2881 $(this).css({'margin-top':'-70px', 'padding-top' : '50px'}).addClass('first-section'); 2882 } 2883 2884 } 2885 2886 } else { 2887 if($(this).index() == '0' && $('#page-header-bg').length != 0 || $(this).index() == '0' && $('.parallax_slider_outer').length != 0){ 2888 $(this).css({'margin-top':'-2.1em', 'padding-top' : '19px'}).addClass('first-section nder-page-header'); 2889 } else if($(this).index() == '0' && $('#page-header-bg').length == 0 || $(this).index() == '0' && $('.parallax_slider_outer').length == 0){ 2890 2891 if($('body[data-header-resize="0"]').length == 1) { 2892 $(this).css({'margin-top':'-30px', 'padding-top' : '50px'}).addClass('first-section'); 2893 } else { 2894 $(this).css({'margin-top':'-70px', 'padding-top' : '50px'}).addClass('first-section'); 2895 } 2896 2897 2898 } 2899 } 2900 2901 }); 2902 2903 2904 2905 $('.parallax_slider_outer').each(function(){ 2906 if(!$(this).parent().hasClass('span_9') && !$(this).parent().hasClass('span_3') && $(this).parent().attr('id') != 'sidebar-inner'){ 2907 2908 if($(this).parents('#portfolio-extra').length > 0 && $('#full_width_portfolio').length == 0) return false; 2909 ////first 2910 if($(this).parent().index() == '0' && $('#page-header-bg').length != 0){ 2911 $(this).addClass('first-section nder-page-header'); 2912 2913 } 2914 else if($(this).parent().index() == '0' && $('#page-header-bg').length == 0){ 2915 $(this).css('margin-top','-40px').addClass('first-section'); 2916 if(!$('body').hasClass('single-post')) $('.container-wrap').css('padding-top', '0px'); 2917 } 2918 2919 //check if it's also last (i.e. the only fws) 2920 if($(this).parent().index() == $contentElementsNum-1 && $('#post-area').length == 0) { 2921 $('#call-to-action .triangle').remove(); 2922 $('.container-wrap').hide(); 2923 } 2924 } 2925 }); 2926 } 2927 2928 //if not using a fullwidth slider first, ajdust the top padding 2929 //if( $('.nectar-slider-wrap.first-section').length > 0 && $('.nectar-slider-wrap.first-section').attr('data-full-width') != 'true' || $('.nectar-slider-wrap.first-section').length > 0 && $('.nectar-slider-wrap.first-section').attr('data-full-width') != 'boxed-full-width' ) $('body').attr('data-bg-header','false'); 2930 //if( $('.wpb_row.first-section:not(".full-width-content") .nectar-slider-wrap').length > 0 && $('.wpb_row.first-section:not(".full-width-content") .nectar-slider-wrap').attr('data-full-width') != 'true' || $('.wpb_row.first-section:not(".full-width-content") .nectar-slider-wrap').length > 0 && $('.wpb_row.first-section:not(".full-width-content") .nectar-slider-wrap').attr('data-full-width') != 'boxed-full-width' ) $('body').attr('data-bg-header','false'); 2931 2932 2933 //set sizes 2934 fullWidthSections(); 2935 fwsClasses(); 2936 2937 //sizing for fullwidth sections that are image only 2938 2939 function fullwidthImgOnlySizingInit(){ 2940 ////set inital sizes 2941 $('.full-width-section:not(.custom-skip)').each(function(){ 2942 2943 var $fwsHeight = $(this).outerHeight(true); 2944 2945 //make sure it's empty and also not being used as a small dvider 2946 if($(this).find('.span_12 *').length == 0 && $.trim( $(this).find('.span_12').text() ).length == 0 && $fwsHeight > 40){ 2947 $(this).addClass('bg-only'); 2948 $(this).css({'height': $fwsHeight, 'padding-top': '0px', 'padding-bottom': '0px'}); 2949 $(this).attr('data-image-height',$fwsHeight); 2950 } 2951 2952 }); 2953 } 2954 2955 function fullwidthImgOnlySizing(){ 2956 2957 $('.full-width-section.bg-only').each(function(){ 2958 var $initialHeight = $(this).attr('data-image-height'); 2959 2960 if( window.innerWidth < 1000 && window.innerWidth > 690 ) { 2961 $(this).css('height', $initialHeight - $initialHeight*.60); 2962 } 2963 2964 else if( window.innerWidth <= 690 ) { 2965 $(this).css('height', $initialHeight - $initialHeight*.78); 2966 } 2967 2968 else if( window.innerWidth < 1300 && window.innerWidth >= 1000 ) { 2969 $(this).css('height', $initialHeight - $initialHeight*.33); 2970 } 2971 2972 else { 2973 $(this).css('height', $initialHeight); 2974 } 2975 2976 }); 2977 2978 } 2979 2980 fullwidthImgOnlySizingInit(); 2981 fullwidthImgOnlySizing(); 2982 2983 2984 2985 //change % padding on rows to be relative to screen 2986 function fullWidthRowPaddingAdjustInit(){ 2987 if($('#boxed').length == 0){ 2988 $('.full-width-section, .full-width-content').each(function(){ 2989 var $topPadding = $(this)[0].style.paddingTop; 2990 var $bottomPadding = $(this)[0].style.paddingBottom; 2991 2992 if($topPadding.indexOf("%") >= 0) $(this).attr('data-top-percent',$topPadding); 2993 if($bottomPadding.indexOf("%") >= 0) $(this).attr('data-bottom-percent',$bottomPadding); 2994 2995 2996 }); 2997 } 2998 } 2999 3000 function fullWidthRowPaddingAdjustCalc(){ 3001 if($('#boxed').length == 0){ 3002 $('.full-width-section[data-top-percent], .full-width-section[data-bottom-percent], .full-width-content[data-top-percent], .full-width-content[data-bottom-percent]').each(function(){ 3003 3004 var $windowHeight = $(window).width(); 3005 var $topPadding = ($(this).attr('data-top-percent')) ? $(this).attr('data-top-percent') : 'skip'; 3006 var $bottomPadding = ($(this).attr('data-bottom-percent')) ? $(this).attr('data-bottom-percent') : 'skip'; 3007 3008 //top 3009 if($topPadding != 'skip') {
3010 $(this).css('padding-top',$windowHeight*(parseInt($topPadding)/100)); 3011 } 3012 3013 //bottom 3014 if($bottomPadding != 'skip'){ 3015 $(this).css('padding-bottom',$windowHeight*(parseInt($bottomPadding)/100)); 3016 } 3017 3018 3019 }); 3020 } 3021 } 3022 fullWidthRowPaddingAdjustInit(); 3023 fullWidthRowPaddingAdjustCalc(); 3024 3025 3026 //full width content column sizing 3027 function fullWidthContentColumns(){ 3028 3029 //standard carousel 3030 $('.main-content > .row > .full-width-content, #portfolio-extra > .full-width-content, .woocommerce-tabs #tab-description > .full-width-content, #post-area.span_12 article .content-inner > .full-width-content').each(function(){ 3031 3032 //only set the height if more than one column 3033 if($(this).find('> .span_12 > .col').length > 1){ 3034 3035 var tallestColumn = 0; 3036 var $columnInnerHeight = 0; 3037 3038 $(this).find('> .span_12 > .col').each(function(){ 3039 3040 var $padding = parseInt($(this).css('padding-top')); 3041 ($(this).find('> .wpb_wrapper').height() + ($padding*2) > tallestColumn) ? tallestColumn = $(this).find('> .wpb_wrapper').height() + ($padding*2) : tallestColumn = tallestColumn; 3042 }); 3043 3044 $(this).find('> .span_12 > .col').each(function(){ 3045 3046 //columns with content 3047 if($(this).find('> .wpb_wrapper > *').length > 0){ 3048 $(this).css('height',tallestColumn); 3049 } 3050 //empty columns 3051 else { 3052 $(this).css('min-height',tallestColumn); 3053 if($(this).is('[data-animation*="reveal"]')) $(this).find('.column-inner').css('min-height',tallestColumn); 3054 } 3055 }); 3056 3057 //nested column height 3058 var $childRows = $(this).find('> .span_12 > .col .wpb_row').length; 3059 if(window.innerWidth > 1000) { 3060 3061 var $padding = parseInt($(this).find('> .span_12 > .col').css('padding-top')); 3062 3063 //$(this).find('> .span_12 > .col .wpb_row .col').css('min-height',(tallestColumn-($padding*2))/$childRows + 'px'); 3064 } else { 3065 $(this).find('> .span_12 > .col .wpb_row .col').css('min-height','0px'); 3066 } 3067 3068 3069 //vertically center 3070 if($(this).hasClass('vertically-align-columns') && window.innerWidth > 1000){ 3071 3072 //parent columns 3073 $(this).find('> .span_12 > .col').each(function(){ 3074
3075 $columnInnerHeight = $(this).find('> .wpb_wrapper').height(); 3076 var $marginCalc = ($(this).height()/2)-($columnInnerHeight/2); 3077 if($marginCalc <= 0) $marginCalc = 0; 3078 3079 $(this).find('> .wpb_wrapper').css('margin-top',$marginCalc); 3080 $(this).find('> .wpb_wrapper').css('margin-bottom',$marginCalc); 3081 3082 }); 3083 3084 3085 } 3086 3087 } 3088 3089 }); 3090 3091 } 3092 3093 fullWidthContentColumns(); 3094 3095 3096 3097 3098function mouseParallaxInit(){ 3099 $('.wpb_row:has(.nectar-parallax-scene)').each(function(){ 3100 3101 if($(this).hasClass('first-section')) { 3102 $('body #header-outer[data-transparent-header="true"] .ns-loading-cover').show(); 3103 3104 if($('body #header-outer[data-transparent-header="true"]').length > 0) { 3105 $(this).css('overflow','hidden'); 3106 $(this).find('.nectar-slider-loading').css({ 3107 'top': $('#header-space').height(), 3108 'margin-top' : '-1px' 3109 }); 3110 $(this).find('.nectar-slider-loading .loading-icon').css({ 3111 'height' : $('.first-section .nectar-parallax-scene').height() - $('#header-space').height() + 'px', 3112 'opacity' : '1' 3113 }); 3114 } 3115 } 3116 3117 var $strength = parseInt($(this).find('.nectar-parallax-scene').attr('data-scene-strength')); 3118 3119 $(this).find('.nectar-parallax-scene').parallax({ 3120 scalarX: $strength, 3121 scalarY: $strength 3122 }); 3123 3124 //wait until the images in the scene have loaded 3125 var images = $(this).find('.nectar-parallax-scene li'); 3126 3127 $.each(images, function(){ 3128 if($(this).find('div').length > 0) { 3129 var el = $(this).find('div'), 3130 image = el.css('background-image').replace(/"/g, '').replace(/url\(|\)$/ig, ''); 3131 if(image && image !== '' && image !== 'none') 3132 images = images.add($('<img>').attr('src', image)); 3133 } 3134 }); 3135 3136 var $that = $(this); 3137 images.imagesLoaded(function(){ 3138 $that.find('> .nectar-slider-loading').fadeOut(800,'easeInOutExpo'); 3139 if($that.hasClass('first-section')) { 3140 $('body #header-outer[data-transparent-header="true"] .ns-loading-cover').fadeOut(800,'easeInOutExpo',function(){ 3141 $(this).remove(); 3142 });
3143 } 3144 }); 3145 3146 }); 3147} 3148mouseParallaxInit(); 3149 3150 3151/***************** Checkmarks ******************/ 3152 3153function ulChecks() { 3154 $('ul.checks li').prepend('<i class="icon-ok-sign"></i>'); 3155} 3156ulChecks(); 3157 3158/***************** Image with Animation / Col Animation *******************/ 3159 3160 3161 3162function colAndImgAnimations(){ 3163 $('img.img-with-animation').each(function() { 3164 3165 var $that = $(this); 3166 var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine'; 3167 var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650'; 3168 3169 var waypoint = new Waypoint({ 3170 element: $that, 3171 handler: function(direction) { 3172 3173 if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 3174 waypoint.destroy(); 3175 return; 3176 } 3177 3178 if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) || $('body[data-responsive="0"]').length > 0) { 3179 3180 if($that.attr('data-animation') == 'fade-in-from-left'){ 3181 $that.delay($that.attr('data-delay')).transition({ 3182 'opacity' : 1, 3183 'left' : '0px' 3184 },$animationDuration, $animationEasing); 3185 } else if($that.attr('data-animation') == 'fade-in-from-right'){ 3186 $that.delay($that.attr('data-delay')).transition({ 3187 'opacity' : 1, 3188 'right' : '0px' 3189 },$animationDuration, $animationEasing); 3190 } else if($that.attr('data-animation') == 'fade-in-from-bottom'){ 3191 $that.delay($that.attr('data-delay')).transition({ 3192 'opacity' : 1, 3193 'y' : '0px' 3194 },$animationDuration, $animationEasing); 3195 } else if($that.attr('data-animation') == 'fade-in') { 3196 $that.delay($that.attr('data-delay')).transition({ 3197 'opacity' : 1 3198 },$animationDuration, $animationEasing); 3199 } else if($that.attr('data-animation') == 'grow-in') { 3200 setTimeout(function(){ 3201 $that.transition({ scale: 1, 'opacity':1 },$animationDuration,'cubic-bezier(0.15, 0.84, 0.35, 1.25)'); 3202 },$that.attr('data-delay')); 3203 } 3204 else if($that.attr('data-animation') == 'flip-in') { 3205 setTimeout(function(){ 3206 $that.transition({ rotateY: 0, 'opacity':1 },$animationDuration, $animationEasing); 3207 },$that.attr('data-delay')); 3208 } 3209 3210 $that.addClass('animated-in'); 3211 3212 } 3213 3214 waypoint.destroy(); 3215 3216 }, 3217 offset: '85%' 3218 }); 3219 3220 3221 3222 }); 3223 3224 3225 $('.col.has-animation:not([data-animation*="reveal"]), .wpb_column.has-animation:not([data-animation*="reveal"])').each(function() { 3226 3227 var $that = $(this); 3228 var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine'; 3229 var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650'; 3230 3231 var waypoint = new Waypoint({ 3232 element: $that, 3233 handler: function(direction) { 3234 3235 if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 3236 waypoint.destroy(); 3237 return; 3238 } 3239 3240 if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) || $('body[data-responsive="0"]').length > 0) { 3241 3242 if($that.attr('data-animation') == 'fade-in-from-left'){ 3243 $that.delay($that.attr('data-delay')).transition({ 3244 'opacity' : 1, 3245 'left' : '0px' 3246 },$animationDuration,$animationEasing); 3247 } else if($that.attr('data-animation') == 'fade-in-from-right'){ 3248 $that.delay($that.attr('data-delay')).transition({ 3249 'opacity' : 1, 3250 'right' : '0px' 3251 },$animationDuration,$animationEasing); 3252 } else if($that.attr('data-animation') == 'fade-in-from-bottom'){ 3253 $that.delay($that.attr('data-delay')).transition({ 3254 'opacity' : 1, 3255 'y' : '0px' 3256 },$animationDuration,$animationEasing); 3257 } else if($that.attr('data-animation') == 'fade-in') { 3258 $that.delay($that.attr('data-delay')).transition({ 3259 'opacity' : 1 3260 },$animationDuration,$animationEasing); 3261 } else if($that.attr('data-animation') == 'grow-in') { 3262 setTimeout(function(){ 3263 $that.transition({ scale: 1, 'opacity':1 },$animationDuration,'cubic-bezier(0.15, 0.84, 0.35, 1.25)'); 3264 },$that.attr('data-delay')); 3265 } else if($that.attr('data-animation') == 'flip-in') { 3266 setTimeout(function(){ 3267 $that.transition({ rotateY: 0, 'opacity':1 },$animationDuration, $animationEasing); 3268 },$that.attr('data-delay')); 3269 } 3270 3271 $that.addClass('animated-in'); 3272 3273 } 3274 3275 waypoint.destroy(); 3276 }, 3277 offset: '85%' 3278 }); 3279 3280 }); 3281 3282 3283 $('.wpb_column.has-animation[data-animation*="reveal"]').each(function() { 3284 3285 var $that = $(this); 3286 var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine'; 3287 var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650'; 3288 3289 var waypoint = new Waypoint({ 3290 element: $that, 3291 handler: function(direction) { 3292 3293 if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 3294 waypoint.destroy(); 3295 return; 3296 } 3297 3298 if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) || $('body[data-responsive="0"]').length > 0) { 3299 3300 if($that.attr('data-animation') == 'reveal-from-bottom' || $that.attr('data-animation') == 'reveal-from-top') { 3301 setTimeout(function(){ 3302 $that.find('.column-inner-wrap, .column-inner').transition({ 'y': 0 },$animationDuration, $animationEasing); 3303 },$that.attr('data-delay')); 3304 } else if($that.attr('data-animation') == 'reveal-from-right' || $that.attr('data-animation') == 'reveal-from-left') { 3305 setTimeout(function(){ 3306 $that.find('.column-inner-wrap, .column-inner').transition({ 'x': 0 },$animationDuration, $animationEasing); 3307 },$that.attr('data-delay')); 3308 } 3309 3310 $that.addClass('animated-in'); 3311 3312 } 3313 3314 waypoint.destroy(); 3315 }, 3316 offset: '70%' 3317 }); 3318 3319 }); 3320 3321 3322} 3323 3324setTimeout(function(){ 3325 if($('.nectar-box-roll').length == 0) colAndImgAnimations(); 3326},$animationOnScrollTimeOut); 3327 3328 3329 3330function splitLineHeadings() { 3331 3332 $('.nectar-split-heading').each(function() { 3333 3334 var $that = $(this); 3335 var $animationEasing = ($('body[data-cae]').length > 0) ? $('body').attr('data-cae') : 'easeOutSine'; 3336 var $animationDuration = ($('body[data-cad]').length > 0) ? $('body').attr('data-cad') : '650'; 3337 3338 var waypoint = new Waypoint({ 3339 element: $that, 3340 handler: function(direction) { 3341 3342 if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 3343 waypoint.destroy(); 3344 return; 3345 } 3346 3347 if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) || $('body[data-responsive="0"]').length > 0) { 3348 3349 3350 $that.find('.heading-line').each(function(i){ 3351 if($that.parents('.first-section').length > 0 && $('body[data-aie="zoom-out"]').length > 0) i = i+4; 3352 $(this).find('> span').delay(i*70).transition({ 3353 'y' : '0px' 3354 },$animationDuration,$animationEasing); 3355 3356 });
3357 3358 3359 $that.addClass('animated-in'); 3360 3361 } 3362 3363 waypoint.destroy(); 3364 }, 3365 offset: 'bottom-in-view' 3366 }); 3367 3368 }); 3369} 3370 3371setTimeout(function() { splitLineHeadings(); },100); 3372 3373/***************** 4 Col Grid in iPad ******************/ 3374 3375 //add one-fourth class 3376 function oneFourthClasses() { 3377 $('.col.span_3, .vc_span3, .vc_col-sm-3').each(function(){ 3378 var $currentDiv = $(this); 3379 var $nextDiv = $(this).next('div'); 3380 if( $nextDiv.hasClass('span_3') && !$currentDiv.hasClass('one-fourths') || $nextDiv.hasClass('vc_span3') && !$currentDiv.hasClass('one-fourths') || $nextDiv.hasClass('vc_col-sm-3') && !$currentDiv.hasClass('one-fourths') ) { 3381 $currentDiv.addClass('one-fourths clear-both'); 3382 $nextDiv.addClass('one-fourths right-edge'); 3383 } 3384 }); 3385 3386 /*$('.vc_span4').each(function(){ 3387 if($(this).find('.team-member').length > 0 && $(this).parents('.full-width-content').length > 0) { 3388 var $currentDiv = $(this); 3389 var $nextDiv = $(this).next('div'); 3390 if( !$currentDiv.hasClass('one-fourths')) { 3391 $currentDiv.addClass('one-fourths clear-both'); 3392 $nextDiv.addClass('one-fourths right-edge'); 3393 } 3394 } 3395 });*/ 3396 3397 //make empty second 1/2 half columsn display right on iPad 3398 $('.span_12 .col.span_6').each(function(){ 3399 if($(this).next('div').hasClass('span_6') && $.trim( $(this).next('div').html() ).length == 0 ) { 3400 $(this).addClass('empty-second') 3401 } 3402 }); 3403 } 3404 oneFourthClasses(); 3405 3406/***************** Bar Graph ******************/ 3407function progressBars(){ 3408 $('.nectar-progress-bar').parent().each(function(i){ 3409 3410 var $that = $(this); 3411 var waypoint = new Waypoint({ 3412 element: $that, 3413 handler: function(direction) { 3414 3415 if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) { 3416 waypoint.destroy(); 3417 return; 3418 } 3419 3420 $that.find('.nectar-progress-bar').each(function(i){ 3421 3422 3423 var percent = $(this).find('span').attr('data-width'); 3424 var $endNum = parseInt($(this).find('span strong i').text()); 3425 var $that = $(this); 3426 3427 $that.find('span').delay(i*90).transition({ 3428 'width' : percent + '%' 3429 },1050, 'easeInOutQuint',function(){ 3430 }); 3431 3432 3433 3434 setTimeout(function(){ 3435 $that.find('span strong i').countTo({ 3436 from: 0, 3437 to: $endNum, 3438 speed: 850, 3439 refreshInterval: 30, 3440 onComplete: function(){ 3441 3442 } 3443 }); 3444 3445 $that.find('span strong').transition({ 3446 'opacity' : 1 3447 },550, 'easeInCirc'); 3448 }, (i*90) ); 3449 3450 ////100% progress bar 3451 if(percent == '100'){ 3452 $that.find('span strong').addClass('full'); 3453 } 3454 }); 3455 3456 $that.addClass('completed'); 3457 3458 waypoint.destroy(); 3459 3460 }, 3461 offset: 'bottom-in-view' 3462 }); 3463 3464 }); 3465} 3466 3467if($('.nectar-box-roll').length == 0) progressBars(); 3468 3469 3470 3471 3472/***************** Pricing Tables ******************/ 3473 3474 3475var $tallestCol; 3476 3477function pricingTableHeight(){ 3478 $('.pricing-table[data-style="default"]').each(function(){ 3479 $tallestCol = 0; 3480 3481 $(this).find('> div ul').each(function(){ 3482 ($(this).height() > $tallestCol) ? $tallestCol = $(this).height() : $tallestCol = $tallestCol; 3483 }); 3484 3485 //safety net incase pricing tables height couldn't be determined 3486 if($tallestCol == 0) $tallestCol = 'auto'; 3487 3488 //set even height 3489 $(this).find('> div ul').css('height',$tallestCol); 3490 3491 }); 3492} 3493 3494pricingTableHeight(); 3495 3496 3497/***************** Testimonial Slider ******************/ 3498 3499//testimonial slider controls 3500$('body').on('click','.testimonial_slider:not([data-style="multiple_visible"]) .controls li', function(){ 3501 3502 if($(this).find('span').hasClass('active')) return false; 3503 3504 var $index = $(this).index(); 3505 var currentHeight = $(this).parents('.testimonial_slider').find('.slides blockquote').eq($index).height(); 3506 3507 $(this).parents('.testimonial_slider').find('li span').removeClass('active'); 3508 $(this).find('span').addClass('active'); 3509 3510 $(this).parents('.testimonial_slider').find('.slides blockquote').stop().css({'opacity':'0', 'left':'-25px', 'z-index': '1'}); 3511 $(this).parents('.testimonial_slider').find('.slides blockquote').eq($index).stop(true,true).animate({'opacity':'1','left':'0'},550,'easeOutCubic').css('z-index','20'); 3512 $(this).parents('.testimonial_slider:not(.disable-height-animation)').find('.slides').stop(true,true).animate({'height' : currentHeight + 40 + 'px' },450,'easeOutCubic'); 3513 3514 resizeVideoToCover(); 3515}); 3516 3517 3518var $tallestQuote; 3519 3520//create controls 3521function createTestimonialControls() { 3522 3523 //fadeIn 3524 $('.testimonial_slider:not([data-style="multiple_visible"])').animate({'opacity':'1'},800); 3525 3526 $('.testimonial_slider:not([data-style="multiple_visible"])').each(function(){ 3527 3528 if($(this).find('blockquote').length > 1 && $(this).find('.controls').length == 0) { 3529 $(this).append('<div class="controls"><ul></ul></div>'); 3530 3531 var slideNum = $(this).find('blockquote').length; 3532 var $that = $(this); 3533 3534 for(var i=0;i<slideNum;i++) { 3535 $that.find('.controls ul').append('<li><span class="pagination-switch"></span></li>') 3536 } 3537 3538 //activate first slide 3539 $(this).find('.controls ul li').first().click(); 3540 3541 //autorotate 3542 if($(this).attr('data-autorotate').length > 0) { 3543 slide_interval = (parseInt($(this).attr('data-autorotate')) < 100) ? 4000 : parseInt($(this).attr('data-autorotate'));
3544 var $that = $(this); 3545 var $rotate = setInterval(function(){ testimonialRotate($that) },slide_interval); 3546 } 3547 3548 $(this).find('.controls li').click(function(e){ 3549 if(typeof e.clientX != 'undefined') clearInterval($rotate); 3550 }); 3551 3552 ////swipe for testimonials 3553 $(this).swipe({ 3554 3555 swipeLeft : function(e) { 3556 $(this).find('.controls ul li span.active').parent().next('li').find('span').trigger('click'); 3557 e.stopImmediatePropagation(); 3558 clearInterval($rotate); 3559 return false; 3560 }, 3561 swipeRight : function(e) { 3562 $(this).find('.controls ul li span.active').parent().prev('li').find('span').trigger('click'); 3563 e.stopImmediatePropagation(); 3564 clearInterval($rotate); 3565 return false; 3566 } 3567 }); 3568 } 3569 //only one testimonial 3570 else if($(this).find('.controls').length == 0) { 3571 var currentHeight = $(this).find('.slides blockquote').height(); 3572 $(this).find('.slides blockquote').stop().css({'opacity':'0', 'left':'-25px', 'z-index': '1'}); 3573 $(this).find('.slides blockquote').stop(true,true).transition({'opacity':'1','left':'0'},550,'easeOutCubic').css('z-index','20'); 3574 $(this).find('.slides').stop(true,true).animate({'height' : currentHeight + 20 + 'px' },450,'easeOutCubic'); 3575 } 3576 }); 3577 3578 3579 3580 3581 $('.testimonial_slider[data-style="multiple_visible"] .slides').each(function(){ 3582 var $that = $(this); 3583 var $element = $that; 3584 var $autoplay = ($that.parents('.testimonial_slider').attr('data-autorotate').length > 1 && parseInt($that.parents('.testimonial_slider').attr('data-autorotate')) > 100) ? parseInt($that.parents('.testimonial_slider').attr('data-autorotate')) : 4000; 3585 if($that.find('img').length == 0) $element = $('body'); 3586 3587 //move img pos 3588 $(this).find('blockquote').each(function(){ 3589 $(this).find('.image-icon').insertAfter($(this).find('p')); 3590 }); 3591 3592 3593 imagesLoaded($element,function(instance){ 3594 3595 $that.flickity({ 3596 contain: true, 3597 draggable: true, 3598 lazyLoad: false, 3599 imagesLoaded: true, 3600 percentPosition: true, 3601 prevNextButtons: false, 3602 pageDots: true, 3603 resize: true, 3604 setGallerySize: true, 3605 wrapAround: true, 3606 autoPlay: $autoplay, 3607 accessibility: false 3608 }); 3609 3610 $that.parents('.testimonial_slider').css('opacity','1'); 3611 3612 3613 });//images loaded 3614 3615 });//each 3616 3617 3618} 3619createTestimonialControls(); 3620 3621function testimonialRotate(slider){ 3622 3623 var $testimonialLength = slider.find('li').length; 3624 var $currentTestimonial = slider.find('.pagination-switch.active').parent().index(); 3625 3626 //stop the rotation when toggles are closed 3627 if( slider.parents('.toggle').length > 0 && slider.parents('.toggle').hasClass('open') ) { 3628 3629 if( $currentTestimonial+1 == $testimonialLength) { 3630 slider.find('ul li:first-child').click(); 3631 } else { 3632 slider.find('.pagination-switch.active').parent().next('li').click(); 3633 } 3634 3635 } else { 3636 3637 if( $currentTestimonial+1 == $testimonialLength) { 3638 slider.find('ul li:first-child').click(); 3639 } else { 3640 slider.find('.pagination-switch.active').parent().next('li').click(); 3641 } 3642 3643 } 3644 3645} 3646 3647function testimonialHeightResize(){ 3648 $('.testimonial_slider:not(.disable-height-animation):not([data-style="multiple_visible"])').each(function(){ 3649 3650 var $index = $(this).find('.controls ul li span.active').parent().index(); 3651 var currentHeight = $(this).find('.slides blockquote').eq($index).height(); 3652 $(this).find('.slides').stop(true,true).css({'height' : currentHeight + 40 + 'px' }); 3653 3654 }); 3655} 3656 3657 3658function testimonialSliderHeight() { 3659 3660 $('.testimonial_slider.disable-height-animation:not([data-style="multiple_visible"])').each(function(){ 3661 $tallestQuote = 0; 3662 3663 $(this).find('blockquote').each(function(){ 3664 ($(this).height() > $tallestQuote) ? $tallestQuote = $(this).height() : $tallestQuote = $tallestQuote; 3665 }); 3666 3667 //safety net incase height couldn't be determined 3668 if($tallestQuote == 0) $tallestQuote = 100; 3669 3670 //set even height 3671 $(this).find('.slides').css('height',$tallestQuote+40+'px'); 3672 3673 //show the slider once height is set 3674 $(this).animate({'opacity':'1'}); 3675 3676 fullWidthContentColumns(); 3677 3678 }); 3679 3680} 3681 3682testimonialSliderHeight(); 3683 3684 3685 3686/***************** WP Media Embed / External Embed ******************/ 3687 3688//this isn't the for the video shortcode* This is to help any external iframe embed fit & resize correctly 3689function responsiveVideoIframesInit(){ 3690 $('iframe').each(function(){ 3691 3692 //make sure the iframe has a src (things like adsense don't) 3693 if(typeof $(this).attr('src') != 'undefined' && !$(this).parent().hasClass('iframe-embed') && $(this).parents('.ult_modal').length == 0 && $(this).parents('.ls-slide').length == 0 && $(this).parents('.esg-entry-media').length == 0){ 3694 3695 if( $(this).attr('src').toLowerCase().indexOf("youtube") >= 0 || $(this).attr('src').toLowerCase().indexOf("vimeo") >= 0 || $(this).attr('src').toLowerCase().indexOf("twitch.tv") >= 0 || $(this).attr('src').toLowerCase().indexOf("kickstarter") >= 0 || $(this).attr('src').toLowerCase().indexOf("embed-ssl.ted") >= 0 || $(this).attr('src').toLowerCase().indexOf("dailymotion") >= 0) { 3696 $(this).wrap('<div class="iframe-embed"/>'); 3697 3698 $(this).attr('data-aspectRatio', this.height / this.width).removeAttr('height').removeAttr('width'); 3699 3700 //add wmode=transparent to all youytube embeds to fix z-index issues in IE 3701 if($(this).attr('src').indexOf('wmode=transparent') == -1) { 3702 if($(this).attr('src').indexOf('?') == -1){ 3703 $(this).attr('src',$(this).attr('src') + '?wmode=transparent'); 3704 } else { 3705 $(this).attr('src',$(this).attr('src') + '&wmode=transparent'); 3706 } 3707 } 3708 } 3709 3710 } else { 3711 //if($(this).parents('ins').length == 0){ 3712 // $(this).wrap('<div class="iframe-embed-standard"/>'); 3713 //} 3714 } 3715 3716 }); 3717 3718 3719} 3720 3721function responsiveVideoIframes(){ 3722 $('iframe[data-aspectRatio]').each(function() { 3723 var newWidth = $(this).parent().width(); 3724 3725 var $el = $(this); 3726 3727 //in nectar slider 3728 if($(this).parents('.swiper-slide').length > 0) { 3729 if($(this).is(':visible')) $el.width(newWidth).height(newWidth * $el.attr('data-aspectRatio')); 3730 } 3731 //all others 3732 else { 3733 $el.width(newWidth).height(newWidth * $el.attr('data-aspectRatio')); 3734 } 3735 3736 3737 }); 3738} 3739 3740 3741function videoshortcodeSize(){ 3742 $('.wp-video').each(function(){ 3743 3744 $(this).attr('data-aspectRatio', parseInt($(this).find('.mejs-overlay').height()) / parseInt($(this).find('.wp-video-shortcode').css('width'))); 3745 3746 var newWidth = $(this).width(); 3747 3748 var $el = $(this).find('.wp-video-shortcode'); 3749 $(this).width(newWidth).height(newWidth * $(this).attr('data-aspectRatio')); 3750 }); 3751} 3752 3753responsiveVideoIframesInit(); 3754responsiveVideoIframes(); 3755videoshortcodeSize(); 3756 3757//unwrap post and protfolio videos 3758$('.video-wrap iframe').unwrap(); 3759$('#sidebar iframe[src]').unwrap(); 3760 3761$('video:not(.slider-video)').attr('width','100%'); 3762$('video:not(.slider-video)').attr('height','100%'); 3763 3764$('audio').attr('width','100%'); 3765$('audio').attr('height','100%'); 3766 3767$('audio').css('visibility','visible'); 3768 3769if($('body').hasClass('mobile')){ 3770 $('video').css('visibility','hidden'); 3771} else { 3772 $('video').css('visibility','visible'); 3773} 3774 3775 3776$(window).load(function(){ 3777 $('video').css('visibility','visible'); 3778 showLateIframes(); 3779 videoshortcodeSize(); 3780}); 3781 3782$('.wp-video').each(function(){ 3783 video = $(this).find('video').get(0); 3784 video.addEventListener('loadeddata', function() { 3785 videoshortcodeSize(); 3786 $(window).trigger('resize'); 3787 }, false); 3788}); 3789 3790//webkit video back button fix 3791$('.main-content iframe[src]').each(function(){ 3792 $(this).attr('src',$(this).attr('src')); 3793 $(this).css({'opacity':'1', 'visibility':'visible'}); 3794}); 3795 3796showLateIframes(); 3797 3798function showLateIframes(){ 3799 $('iframe[src]').css('opacity','1'); 3800 setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 100); 3801 setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 500); 3802 setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 1000); 3803 setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 1500); 3804 setTimeout(function(){ $('iframe[src]').css('opacity','1'); }, 2500); 3805} 3806 3807 3808/***************** Nectar Video BG ******************/ 3809 3810 3811 3812 $('.wpb_row:has(".nectar-video-wrap")').each(function(i){ 3813 $(this).css('z-index',100 + i); 3814 }); 3815 3816 var min_w = 1200; // minimum video width allowed 3817 var vid_w_orig; // original video dimensions 3818 var vid_h_orig; 3819 3820 vid_w_orig = 1280; 3821 vid_h_orig = 720; 3822 3823 function resizeVideoToCover() { 3824 $('.nectar-video-wrap').each(function(i){ 3825 3826 if($(this).parents('#page-header-bg').length > 0) { 3827 if($('.container-wrap.auto-height').length > 0) return false; 3828 var $containerHeight = $(this).parents('#page-header-bg').outerHeight(); 3829 var $containerWidth = $(this).parents('#page-header-bg').outerWidth(); 3830 } else { 3831 var $containerHeight = $(this).parents('.wpb_row').outerHeight(); 3832 var $containerWidth = $(this).parents('.wpb_row').outerWidth(); 3833 } 3834 3835 // set the video viewport to the window size 3836 $(this).width($containerWidth);
3837 $(this).height($containerHeight); 3838 3839 // use largest scale factor of horizontal/vertical 3840 var scale_h = $containerWidth / vid_w_orig; 3841 var scale_v = ($containerHeight - $containerHeight) / vid_h_orig; 3842 var scale = scale_h > scale_v ? scale_h : scale_v; 3843 3844 //update minium width to never allow excess space 3845 min_w = 1280/720 * ($containerHeight+40); 3846 3847 // don't allow scaled width < minimum video width 3848 if (scale * vid_w_orig < min_w) {scale = min_w / vid_w_orig;} 3849 3850 // now scale the video 3851 $(this).find('video, .mejs-overlay, .mejs-poster').width(Math.ceil(scale * vid_w_orig +0)); 3852 $(this).find('video, .mejs-overlay, .mejs-poster').height(Math.ceil(scale * vid_h_orig +0)); 3853 3854 // and center it by scrolling the video viewport 3855 $(this).scrollLeft(($(this).find('video').width() - $containerWidth) / 2); 3856 $(this).scrollTop(($(this).find('video').height() - ($containerHeight)) / 2); 3857 $(this).find('.mejs-overlay, .mejs-poster').scrollTop(($(this).find('video').height() - ($containerHeight)) / 2); 3858 3859 3860 //align bottom 3861 if($(this).attr('data-bg-alignment') == 'center bottom' || $(this).attr('data-bg-alignment') == 'bottom'){ 3862 $(this).scrollTop(($(this).find('video').height() - ($containerHeight+6))); 3863 } 3864 //align top 3865 else if($(this).attr('data-bg-alignment') == 'center top' || $(this).attr('data-bg-alignment') == 'top') { 3866 $(this).scrollTop(0); 3867 } 3868 3869 }); 3870 } 3871 3872 //init 3873 function videoBGInit(){ 3874 setTimeout(function(){ 3875 resizeVideoToCover(); 3876 $('.video-color-overlay').each(function(){ 3877 $(this).css('background-color',$(this).attr('data-color')); 3878 }); 3879 $('.nectar-video-wrap').each(function(i){ 3880 var $headerVideo = ($(this).parents('#page-header-bg').length > 0) ? true : false; 3881 var $that = $(this); 3882 3883 var videoReady = setInterval(function(){ 3884 3885 if($that.find('video').get(0).readyState > 3) { 3886 3887 $that.transition({'opacity':'1'},400); 3888 $that.find('video').transition({'opacity':'1'},400); 3889 $that.parent().find('.video-color-overlay').transition({'opacity':'0.7'},400); 3890 3891 if($headerVideo == true) { 3892 pageHeaderTextEffect(); 3893 } 3894 3895 //remove page loading screen 3896 $('#ajax-loading-screen').addClass('loaded'); 3897 setTimeout(function(){ $('#ajax-loading-screen').addClass('hidden'); },1000); 3898 3899 3900 clearInterval(videoReady); 3901 } 3902 },60); 3903 3904 }); 3905 },300); 3906 3907 if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){ 3908 $('.wpb_row .mobile-video-image, #page-header-wrap .mobile-video-image, .fullscreen-header .mobile-video-image').show(); 3909 $('.nectar-video-wrap').remove(); 3910 } 3911 3912 3913 if(navigator.userAgent.indexOf('Chrome') > 0 && !/Edge\/12./i.test(navigator.userAgent) && !/Edge\/13./i.test(navigator.userAgent)) { 3914 $('.nectar-video-wrap').each(function(i){ 3915 if(jQuery(this).find('video source[type="video/webm"]').length > 0 ) { 3916 var webmSource = jQuery(this).find('video source[type="video/webm"]').attr('src') + "?id="+Math.ceil(Math.random()*10000); 3917 var firstVideo = jQuery(this).find('video').get(0); 3918 firstVideo.src = webmSource; 3919 firstVideo.load(); 3920 } 3921 }); 3922 } 3923 } 3924 videoBGInit(); 3925 3926 3927/*-------------------------------------------------------------------------*/ 3928/* 4. Header + Search 3929/*-------------------------------------------------------------------------*/ 3930 3931/***************** Slide Out Widget Area **********/ 3932 3933$('body').on('click','.slide-out-widget-area-toggle a.closed:not(.animating)',function(){ 3934 if(animating == 'true') return false; 3935 var $that = $(this); 3936 3937 //slide out from right 3938 if($('#slide-out-widget-area').hasClass('slide-out-from-right')) { 3939 3940 //calc height if used bottom meta 3941 $('#slide-out-widget-area .inner').css({'height':'auto', 'min-height': $('#slide-out-widget-area').height() - 25 - $('.bottom-meta-wrap').height() }); 3942 3943 if($('#boxed').length == 0) { 3944 $('.container-wrap, .home-wrap, #header-secondary-outer, #footer-outer, .nectar-box-roll, .parallax_slider_outer .swiper-slide .image-bg, .parallax_slider_outer .swiper-slide .video-wrap, .parallax_slider_outer .swiper-slide .mobile-video-image, .parallax_slider_outer .swiper-slide .container, #page-header-wrap .page-header-bg-image, #page-header-wrap .nectar-video-wrap, #page-header-wrap .mobile-video-image, #page-header-wrap #page-header-bg > .container, .page-header-no-bg, div:not(.container) > .project-title').stop(true).transition({ x: '-300px' },700,'easeInOutCubic'); 3945 3946 if($('#header-outer[data-transparency-option="1"]').length == 0) { 3947 $('#header-outer').stop(true).css('transform','translateY(0)').transition({ x: '-300px'},700,'easeInOutCubic'); 3948 } else { 3949 $('#header-outer').stop(true).css('transform','translateY(0)').transition({ x: '-300px', 'background-color':'transparent', 'border-bottom': '1px solid rgba(255,255,255,0.22)' },700,'easeInOutCubic'); 3950 } 3951 3952 $('#ascrail2000').transition({ 'x': '-300px' },700,'easeInOutCubic'); 3953 $('body:not(.ascend) #header-outer .cart-menu').stop(true).transition({ 'x': '300px' },700,'easeInOutCubic'); 3954 } 3955 3956 $('#slide-out-widget-area').stop(true).transition({ x: '0' },700,'easeInOutCubic').addClass('open'); 3957 3958 3959 if($('#boxed').length == 0) { 3960 //full width menu adjustments 3961 if($('#header-outer[data-full-width="true"]').length > 0 && !$('body').hasClass('mobile')) { 3962 $('#header-outer').addClass('highzI'); 3963 $('#ascrail2000').addClass('z-index-adj'); 3964 $('header#top #logo').stop(true).transition({ x: '300px' },700,'easeInOutCubic'); 3965 3966 $('header#top nav > ul > li.megamenu > ul.sub-menu').stop(true).transition({'width': $(window).width() - 360, 'left': '300px' },700,'easeInOutCubic'); 3967 $('header#top .slide-out-widget-area-toggle .lines-button').addClass('close'); 3968 3969 if($('#header-outer[data-remove-border="true"]').length > 0) { 3970 $('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '64px' },700,'easeInOutCubic'); 3971 } else { 3972 $('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '89px' },700,'easeInOutCubic'); 3973 } 3974 3975 $('body #header-outer nav > ul > li > a').css({'margin-bottom':'0'}); 3976 3977 } 3978 } 3979 3980 $('#header-outer').addClass('style-slide-out-from-right'); 3981 3982 //fade In BG Overlay 3983 $('#slide-out-widget-area-bg').css({'height':'100%','width':'100%'}).stop(true).transition({ 3984 'opacity' : 1 3985 },700,'easeInOutCubic',function(){ 3986 $('.slide-out-widget-area-toggle > div > a').removeClass('animating'); 3987 }); 3988 3989 //hide menu if no space 3990 $logoWidth = ($('#logo img:visible').length > 0) ? $('#logo img:visible').width() : $('#logo').width(); 3991 if($('header#top nav > .sf-menu').offset().left - $logoWidth - 300 < 20) $('#header-outer').addClass('hidden-menu'); 3992 3993 3994 3995 } else if($('#slide-out-widget-area').hasClass('fullscreen')) { 3996 3997 //scroll away from fixed reveal footer if shown (firefox bug with bluring over it)
3998 var $scrollDelay = 0; 3999 var $scrollDelay2 = 0; 4000 4001 if($(window).scrollTop() + $(window).height() > $('.blurred-wrap').height()) { 4002 $('body,html').stop().animate({ 4003 scrollTop: $('.blurred-wrap').height() - $(window).height() 4004 },600,'easeInOutCubic'); 4005 $scrollDelay = 550; 4006 $scrollDelay2 = 200; 4007 } 4008 4009 $('header#top .slide-out-widget-area-toggle .lines-button').addClass('close'); 4010 setTimeout(function(){ $('.blurred-wrap').addClass('blurred'); },$scrollDelay); 4011 $('#slide-out-widget-area.fullscreen').show().addClass('open'); 4012 4013 hideToTop(); 4014 4015 //remove box shadow incase at the top of the page with nectar box roll above 4016 $('.container-wrap').addClass('no-shadow'); 4017 $('#header-outer').stop(true).css('transform','translateY(0)'); 4018 4019 setTimeout(function(){ 4020 4021 $('.off-canvas-menu-container .menu > li').each(function(i){ 4022 $(this).delay(i*50).transition({y: 0, 'opacity': 1},800,'easeOutExpo'); 4023 }); 4024 4025 $('#slide-out-widget-area.fullscreen .widget').each(function(i){ 4026 $(this).delay(i*100).transition({y: 0, 'opacity': 1},800,'easeOutExpo'); 4027 }); 4028 },300+$scrollDelay2); 4029 4030 setTimeout(function(){ 4031 $('#slide-out-widget-area .off-canvas-social-links').addClass('line-shown'); 4032 4033 $('#slide-out-widget-area .off-canvas-social-links li').each(function(i){ 4034 $(this).delay(i*50).transition({'scale':1},400,'easeOutCubic'); 4035 }); 4036 $('#slide-out-widget-area .bottom-text').transition({'opacity':0.7},400,'easeOutCubic'); 4037 },700+$scrollDelay2); 4038 4039 //fade In BG Overlay 4040 setTimeout(function(){ 4041 $easing = ($('body.mobile').length > 0) ? 'easeOutCubic' : 'easeInOutQuint'; 4042 $('#slide-out-widget-area-bg').css({'height':'100%','width':'100%'}).show().stop(true).transition({ 4043 'y' : '0%' 4044 },920,$easing,function(){ 4045 $('.slide-out-widget-area-toggle > div > a').removeClass('animating'); 4046 }); 4047 },50+$scrollDelay2); 4048 4049 //overflow state 4050 slideOutWidgetOverflowState(); 4051 if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0 && $('.container-wrap').hasClass('no-scroll')) $('#ajax-content-wrap').addClass('at-content'); 4052 if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0 || $('.mobile').length == 0 && $('#header-outer.transparent').length == 0) $('#slide-out-widget-area.fullscreen .inner-wrap').css('padding-top', $('#header-outer').height()); 4053 } 4054 4055 4056 4057 4058 4059 4060 //add open class 4061 $('#header-outer').removeClass('side-widget-closed').addClass('side-widget-open'); 4062 4063 //give header transparent state 4064 if($('#header-outer[data-transparency-option="1"]').length > 0 && $('#boxed').length == 0 && $('#header-outer[data-full-width="true"]').length > 0) { 4065 $('#header-outer').addClass('transparent'); 4066 } 4067 4068 //dark slide transparent nav 4069 if($('#header-outer.dark-slide.transparent').length > 0 && $('#boxed').length == 0) $('#header-outer').removeClass('dark-slide').addClass('temp-removed-dark-slide'); 4070 4071 $('.slide-out-widget-area-toggle > div > a').removeClass('closed').addClass('open'); 4072 $('.slide-out-widget-area-toggle > div > a').addClass('animating'); 4073 4074 return false; 4075}); 4076 4077$('body').on('click','.slide-out-widget-area-toggle a.open:not(.animating), #slide-out-widget-area .slide_out_area_close',function(){ 4078 4079 var $that = $(this); 4080 4081 $('.slide-out-widget-area-toggle a').removeClass('open').addClass('closed'); 4082 $('.slide-out-widget-area-toggle a').addClass('animating'); 4083 4084 //slide out from right 4085 if($('#slide-out-widget-area').hasClass('slide-out-from-right')) { 4086 4087 $('.container-wrap, .home-wrap, #header-secondary-outer, #footer-outer, .nectar-box-roll, .parallax_slider_outer .swiper-slide .image-bg, .parallax_slider_outer .swiper-slide .container, .parallax_slider_outer .swiper-slide .video-wrap, .parallax_slider_outer .swiper-slide .mobile-video-image, #page-header-wrap .page-header-bg-image, #page-header-wrap .nectar-video-wrap, #page-header-wrap .mobile-video-image, #page-header-wrap #page-header-bg > .container, .page-header-no-bg, div:not(.container) > .project-title').stop(true).transition({ x: '0px' },700,'easeInOutCubic'); 4088 4089 if($('#header-outer[data-transparency-option="1"]').length > 0 && $('#boxed').length == 0) { 4090 $currentRowBG = ($('#header-outer[data-current-row-bg-color]').length > 0) ? $('#header-outer').attr('data-current-row-bg-color') : $('#header-outer').attr('data-user-set-bg'); 4091 $('#header-outer').stop(true).transition({ x: '0px', 'background-color': $currentRowBG },700,'easeInOutCubic'); 4092 } else { 4093 $('#header-outer').stop(true).transition({ x: '0px' },700,'easeInOutCubic'); 4094 } 4095 4096 $('#ascrail2000').stop(true).transition({ 'x': '0px' },700,'easeInOutCubic'); 4097 $('body:not(.ascend) #header-outer .cart-menu').stop(true).transition({ 'x': '0px' },700,'easeInOutCubic'); 4098 4099 $('#slide-out-widget-area').stop(true).transition({ x: '301px' },700,'easeInOutCubic').removeClass('open'); 4100 4101 4102 if($('#boxed').length == 0) { 4103 if($('#header-outer[data-full-width="true"]').length > 0) { 4104 $('#header-outer').removeClass('highzI'); 4105 $('header#top #logo').stop(true).transition({ x: '0px' },700,'easeInOutCubic'); 4106 $('header#top nav > ul > li.megamenu > ul.sub-menu').stop(true).transition({'width': '100%', 'left': '0' },700,'easeInOutCubic'); 4107 $('.lines-button').removeClass('close'); 4108 4109 $('body:not(.ascend) #header-outer[data-full-width="true"] header#top nav > ul.product_added').stop(true).transition({ x: '0px' },700,'easeInOutCubic'); 4110 4111 } 4112 } 4113 4114 //fade out overlay 4115 $('#slide-out-widget-area-bg').stop(true).transition({ 4116 'opacity' : 0 4117 },700,'easeInOutCubic',function(){ 4118 $('.slide-out-widget-area-toggle a').removeClass('animating'); 4119 $(this).css({'height':'1px','width':'1px'}); 4120 4121 //hide menu if transparent, user has scrolled down and hhun is on 4122 if($('#header-outer').hasClass('parallax-contained') && $(window).scrollTop() > 0 && $('#header-outer[data-permanent-transparent="1"]').length == 0) { 4123 $('#header-outer').removeClass('parallax-contained').addClass('detached').removeClass('transparent'); 4124 } 4125 else if($(window).scrollTop() == 0 && $('body[data-hhun="1"]').length >
4125 0 && $('#page-header-bg[data-parallax="1"]').length > 0 || 4126 $(window).scrollTop() == 0 && $('body[data-hhun="1"]').length > 0 && $('.parallax_slider_outer').length > 0) { 4127 4128 if($('#header-outer[data-transparency-option="1"]').length > 0) $('#header-outer').addClass('transparent'); 4129 $('#header-outer').addClass('parallax-contained').removeClass('detached'); 4130 } 4131 4132 //fix for fixed subpage menu 4133 $('.container-wrap').css('transform','none'); 4134 }); 4135 4136 4137 $('#header-outer').removeClass('style-slide-out-from-right'); 4138 4139 4140 } else if($('#slide-out-widget-area').hasClass('fullscreen')) { 4141 4142 4143 $('.lines-button').removeClass('close'); 4144 //$('.slide-out-widget-area-toggle a').removeClass('animating'); 4145 $('.blurred-wrap').removeClass('blurred'); 4146 $('#slide-out-widget-area.fullscreen').transition({'opacity': 0 },700,'easeOutQuad',function(){ $('#slide-out-widget-area.fullscreen').hide().css('opacity','1'); }).removeClass('open'); 4147 $('#slide-out-widget-area.fullscreen .widget').transition({'opacity': 0},700,'easeOutQuad',function(){ 4148 $(this).transition({y: '110px'},0); 4149 }); 4150 4151 setTimeout(function(){ 4152 $('.off-canvas-menu-container .menu > li').transition({y: '80px', 'opacity': 0},0); 4153 $('#slide-out-widget-area .off-canvas-social-links li').transition({'scale':0},0); 4154 $('#slide-out-widget-area .off-canvas-social-links').removeClass('line-shown'); 4155 $('#slide-out-widget-area .bottom-text').transition({'opacity':0},0); 4156 4157 //close submenu items 4158 $('#slide-out-widget-area .menuwrapper .menu').removeClass( 'subview' ); 4159 $('#slide-out-widget-area .menuwrapper .menu li').removeClass( 'subview subviewopen' ); 4160 $('#slide-out-widget-area.fullscreen .inner .off-canvas-menu-container').css('height','auto'); 4161 },800); 4162 4163 setTimeout(function(){ 4164 showToTop(); 4165 $('.container-wrap').removeClass('no-shadow'); 4166 },500); 4167 4168 //fade out overlay 4169 $('#slide-out-widget-area-bg').stop(true).transition({'opacity': 0},900,'easeOutQuad',function(){ 4170 if($('.mobile #header-outer[data-permanent-transparent="false"]').length > 0 && $('.container-wrap').hasClass('no-scroll')) $('#ajax-content-wrap').removeClass('at-content'); 4171 if($('.mobile #header-outer[data-permanent-transparent="false"]').length == 0) $('#slide-out-widget-area.fullscreen .inner-wrap').css('padding-top', '0'); 4172 $('.slide-out-widget-area-toggle a').removeClass('animating'); 4173 if($('#slide-out-widget-area-bg').hasClass('dark')) $opacity = 0.93; 4174 if($('#slide-out-widget-area-bg').hasClass('medium')) $opacity = 0.6; 4175 if($('#slide-out-widget-area-bg').hasClass('light')) $opacity = 0.4; 4176 $(this).css({'height':'1px','width':'1px', 'opacity': $opacity}).transition({ y : '-100%'},0); 4177 }); 4178 4179 4180 } 4181 4182 4183 4184 4185 //dark slide transparent nav 4186 if($('#header-outer.temp-removed-dark-slide.transparent').length > 0 && $('#boxed').length == 0) $('#header-outer').removeClass('temp-removed-dark-slide').addClass('dark-slide'); 4187 4188 //remove header transparent state 4189 4190 if($('#header-outer[data-permanent-transparent="1"]').length == 0) { 4191 4192 if($('.nectar-box-roll').length == 0) { 4193 if($('#header-outer.small-nav').length > 0 || $('#header-outer.scrolled-down').length > 0 || $('#header-outer.detached').length > 0) $('#header-outer').removeClass('transparent'); 4194 } else { 4195 if($('#header-outer.small-nav').length > 0 || $('#header-outer.scrolled-down').length > 0 || $('.container-wrap.auto-height').length > 0) $('#header-outer').removeClass('transparent'); 4196 } 4197 } 4198 4199 4200 4201 //remove hidden menu 4202 $('#header-outer').removeClass('hidden-menu'); 4203 4204 $('#header-outer').removeClass('side-widget-open').addClass('side-widget-closed'); 4205 4206 return false; 4207}); 4208 4209function slideOutWidgetOverflowState() { 4210 4211 4212 //switch position of social media/extra info based on screen size 4213 if(window.innerWidth < 1000 || $('body > #boxed').length > 0) { 4214 $('#slide-out-widget-area.fullscreen .off-canvas-social-links').appendTo('#slide-out-widget-area .inner'); 4215 $('#slide-out-widget-area.fullscreen .bottom-text').appendTo('#slide-out-widget-area .inner'); 4216 } else { 4217 $('#slide-out-widget-area.fullscreen .off-canvas-social-links').appendTo('#slide-out-widget-area .inner-wrap'); 4218 $('#slide-out-widget-area.fullscreen .bottom-text').appendTo('#slide-out-widget-area .inner-wrap'); 4219 } 4220 4221 //add overflow 4222 if( $('#slide-out-widget-area.fullscreen .inner').height() >= $(window).height()-100) { $('#slide-out-widget-area.fullscreen .inner, #slide-out-widget-area.fullscreen').addClass('overflow-state'); } 4223 else { $('#slide-out-widget-area.fullscreen .inner, #slide-out-widget-area.fullscreen').removeClass('overflow-state'); } 4224 4225 $('#slide-out-widget-area.fullscreen .inner').transition({ y : '-' + ($('#slide-out-widget-area.fullscreen .inner').height()/2) + 'px' },0); 4226 4227 //close mobile only slide out widget area if switching back to desktop 4228 if($('.slide-out-from-right.open .off-canvas-menu-container.mobile-only').length > 0 && $('body.mobile').length == 0) $('#slide-out-widget-area .slide_out_area_close').trigger('click'); 4229 4230} 4231 4232function fullWidthHeaderSlidingWidgetMenuCalc() { 4233 $('header#top nav > ul > li.megamenu > ul.sub-menu').stop(true).transition({'width': $(window).width() - 360, 'left': '300px' },700,'easeInOutCubic'); 4234} 4235 4236//slide out widget area scrolling
4237function slideOutWidgetAreaScrolling(){ 4238 $('#slide-out-widget-area').mousewheel(function(event, delta) { 4239 4240 this.scrollTop -= (delta * 30); 4241 4242 event.preventDefault(); 4243 4244 }); 4245} 4246slideOutWidgetAreaScrolling(); 4247 4248 4249//handle mobile scrolling 4250if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) { 4251 $('#slide-out-widget-area').addClass('mobile'); 4252} 4253 4254 4255//fullscreen submenu 4256 4257 4258/** 4259 * jquery.dlmenu.js v1.0.1 4260 * http://www.codrops.com 4261 * 4262 * Licensed under the MIT license. 4263 * http://www.opensource.org/licenses/mit-license.php 4264 * 4265 * Copyright 2013, Codrops 4266 * http://www.codrops.com 4267 */ 4268;( function( $, window, undefined ) { 4269 4270 'use strict'; 4271 4272 // global 4273 var Modernizr = window.Modernizr, $body = $( 'body' ); 4274 4275 $.DLMenu = function( options, element ) { 4276 this.$el = $( element ); 4277 this._init( options ); 4278 }; 4279 4280 // the options 4281 $.DLMenu.defaults = { 4282 // classes for the animation effects 4283 animationClasses : { classin : 'dl-animate-in-1', classout : 'dl-animate-out-1' }, 4284 // callback: click a link that has a sub menu 4285 // el is the link element (li); name is the level name 4286 onLevelClick : function( el, name ) { return false; }, 4287 // callback: click a link that does not have a sub menu 4288 // el is the link element (li); ev is the event obj 4289 onLinkClick : function( el, ev ) { return false; } 4290 }; 4291 4292 $.DLMenu.prototype = { 4293 _init : function( options ) { 4294 4295 // options 4296 this.options = $.extend( true, {}, $.DLMenu.defaults, options ); 4297 // cache some elements and initialize some variables 4298 this._config(); 4299 4300 var animEndEventNames = { 4301 'WebkitAnimation' : 'webkitAnimationEnd', 4302 'OAnimation' : 'oAnimationEnd', 4303 'msAnimation' : 'MSAnimationEnd', 4304 'animation' : 'animationend' 4305 }, 4306 transEndEventNames = { 4307 'WebkitTransition' : 'webkitTransitionEnd', 4308 'MozTransition' : 'transitionend', 4309 'OTransition' : 'oTransitionEnd', 4310 'msTransition' : 'MSTransitionEnd', 4311 'transition' : 'transitionend' 4312 }; 4313 // animation end event name 4314 this.animEndEventName = animEndEventNames[ Modernizr.prefixed( 'animation' ) ] + '.menu'; 4315 // transition end event name 4316 this.transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ] + '.menu', 4317 // support for css animations and css transitions 4318 this.supportAnimations = Modernizr.cssanimations, 4319 this.supportTransitions = Modernizr.csstransitions; 4320 4321 this._initEvents(); 4322 4323 }, 4324 _config : function() { 4325 this.open = false; 4326 this.$trigger = this.$el.children( '.trigger' ); 4327 this.$menu = this.$el.children( 'ul.menu' ); 4328 this.$menuitems = this.$menu.find( 'li:not(.back) > a' ); 4329 this.$el.find( 'ul.sub-menu' ).prepend( '<li class="back"><a href="#"> '+$('#slide-out-widget-area').attr('data-back-txt')+' </a></li>' ); 4330 this.$back = this.$menu.find( 'li.back' ); 4331 }, 4332 _initEvents : function() { 4333 4334 var self = this; 4335 4336 this.$trigger.on( 'click.menu', function() { 4337 4338 if( self.open ) { 4339 self._closeMenu(); 4340 } 4341 else { 4342 self._openMenu(); 4343 } 4344 return false; 4345 4346 } ); 4347 4348 this.$menuitems.on( 'click.menu', function( event ) { 4349 4350 //event.stopPropagation(); 4351 4352 var $item = $(this).parent('li'), 4353 $submenu = $item.children( 'ul.sub-menu' ); 4354 4355 //exit if clicking on background LI (avoids effect wrongly triggering) 4356 //if( $item.find('> a').length > 0 && $item.find('> a').css('display') === 'none') return false; 4357 4358 if( $submenu.length > 0 ) { 4359 4360 var $flyin = $submenu.clone().css( 'opacity', 0 ).insertAfter( self.$menu ), 4361 onAnimationEndFn = function() { 4362 self.$menu.off( self.animEndEventName ).removeClass( self.options.animationClasses.classout ).addClass( 'subview' ); 4363 $item.addClass( 'subviewopen' ).parents( '.subviewopen:first' ).removeClass( 'subviewopen' ).addClass( 'subview' ); 4364 $flyin.remove(); 4365 }; 4366 4367 setTimeout( function() { 4368 $flyin.addClass( self.options.animationClasses.classin ); 4369 self.$menu.addClass( self.options.animationClasses.classout ); 4370 if( self.supportAnimations ) { 4371 self.$menu.on( self.animEndEventName, onAnimationEndFn ); 4372 } 4373 else { 4374 onAnimationEndFn.call(); 4375 } 4376 4377 self.options.onLevelClick( $item, $item.children( 'a:first' ).text() ); 4378 } ); 4379 4380 4381 //adjust height for mobile / widgets below 4382 $item.parents('.off-canvas-menu-container').css('height',$item.parents('.off-canvas-menu-container').find('.menuwrapper .menu').height()).transition({ 'height': $flyin.height() },500,'easeInOutQuad' ); 4383 4384 return false; 4385 4386 } 4387 else { 4388 4389 self.options.onLinkClick( $item.find('> a'), event ); 4390 } 4391 4392 }); 4393 4394 4395 4396 4397 this.$back.on( 'click.menu', function( event ) { 4398 4399 var $this = $( this ), 4400 $submenu = $this.parents( 'ul.sub-menu:first' ), 4401 $item = $submenu.parent(), 4402 4403 $flyin = $submenu.clone().insertAfter( self.$menu ); 4404 4405 var onAnimationEndFn = function() { 4406 self.$menu.off( self.animEndEventName ).removeClass( self.options.animationClasses.classin ); 4407 $flyin.remove(); 4408 }; 4409 4410 setTimeout( function() { 4411 $flyin.addClass( self.options.animationClasses.classout ); 4412 self.$menu.addClass( self.options.animationClasses.classin ); 4413 if( self.supportAnimations ) { 4414 self.$menu.on( self.animEndEventName, onAnimationEndFn ); 4415 } 4416 else { 4417 onAnimationEndFn.call(); 4418 } 4419 4420 $item.removeClass( 'subviewopen' ); 4421 4422 var $subview = $this.parents( '.subview:first' ); 4423 if( $subview.is( 'li' ) ) { 4424 $subview.addClass( 'subviewopen' ); 4425 } 4426 $subview.removeClass( 'subview' ); 4427 } ); 4428 4429 4430 //adjust height for mobile / widgets below 4431 $item.parents('.off-canvas-menu-container').css('height', $item.parents('.off-canvas-menu-container').find('.menuwrapper .menu').height()) 4432 setTimeout(function() { 4433 $item.parents('.off-canvas-menu-container').transition({ 'height': $item.parent().height() },500,'easeInOutQuad'); 4434 },50); 4435 4436 4437 return false; 4438 4439 } ); 4440 4441 }, 4442 closeMenu : function() { 4443 if( this.open ) { 4444 this._closeMenu(); 4445 } 4446 }, 4447 _closeMenu : function() { 4448 var self = this, 4449 onTransitionEndFn = function() { 4450 self.$menu.off( self.transEndEventName ); 4451 self._resetMenu(); 4452 }; 4453 4454 this.$menu.removeClass( 'menuopen' ); 4455 this.$menu.addClass( 'menu-toggle' ); 4456 this.$trigger.removeClass( 'active' ); 4457 4458 if( this.supportTransitions ) { 4459 this.$menu.on( this.transEndEventName, onTransitionEndFn ); 4460 } 4461 else { 4462 onTransitionEndFn.call(); 4463 } 4464 4465 this.open = false; 4466 }, 4467 openMenu : function() { 4468 if( !this.open ) { 4469 this._openMenu(); 4470 } 4471 }, 4472 _openMenu : function() { 4473 var self = this; 4474 // clicking somewhere else makes the menu close 4475 $body.off( 'click' ).on( 'click.menu', function() { 4476 self._closeMenu() ; 4477 } ); 4478 this.$menu.addClass( 'menuopen menu-toggle' ).on( this.transEndEventName, function() { 4479 $( this ).removeClass( 'menu-toggle' ); 4480 } ); 4481 this.$trigger.addClass( 'active' ); 4482 this.open = true; 4483 }, 4484 // resets the menu to its original state (first level of options) 4485 _resetMenu : function() { 4486 this.$menu.removeClass( 'subview' ); 4487 this.$menuitems.removeClass( 'subview subviewopen' ); 4488 } 4489 }; 4490 4491 var logError = function( message ) { 4492 if ( window.console ) { 4493 window.console.error( message ); 4494 } 4495 }; 4496 4497 $.fn.dlmenu = function( options ) { 4498 if ( typeof options === 'string' ) { 4499 var args = Array.prototype.slice.call( arguments, 1 ); 4500 this.each(function() { 4501 var instance = $.data( this, 'menu' ); 4502 if ( !instance ) { 4503 logError( "cannot call methods on menu prior to initialization; " + 4504 "attempted to call method '" + options + "'" ); 4505 return; 4506 } 4507 if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) { 4508 logError( "no such method '" + options + "' for menu instance" ); 4509 return; 4510 } 4511 instance[ options ].apply( instance, args ); 4512 }); 4513 } 4514 else { 4515 this.each(function() { 4516 var instance = $.data( this, 'menu' ); 4517 if ( instance ) { 4518 instance._init(); 4519 } 4520 else { 4521 instance = $.data( this, 'menu', new $.DLMenu( options, this ) ); 4522 } 4523 }); 4524 } 4525 return this; 4526 }; 4527 4528} )( jQuery, window ); 4529 4530function fullscreenMenuInit() { 4531 $('#slide-out-widget-area .off-canvas-menu-container .menu').wrap('<div class="menu-wrap menuwrapper" />'); 4532 $('#slide-out-widget-area .off-canvas-menu-container .menu').addClass('menuopen'); 4533 $('#slide-out-widget-area .off-canvas-menu-container .menu-wrap').dlmenu({ animationClasses : { classin : 'dl-animate-in-5', classout : 'dl-animate-out-5' } }); 4534} 4535fullscreenMenuInit(); 4536 4537//submenu link hover fix 4538$('body').on('mouseover','#slide-out-widget-area .off-canvas-menu-container .menuwrapper > .sub-menu li > a',function(){ 4539 var $currentTxt = $(this).text(); 4540 $('.off-canvas-menu-container .menuwrapper .menu li > a').removeClass('hovered'); 4541 $('.off-canvas-menu-container .menuwrapper .menu li > a:contains('+$currentTxt+')').addClass('hovered'); 4542}); 4543$('body').on('mouseover','.off-canvas-menu-container .menuwrapper .menu li > a',function(){ 4544 $('.off-canvas-menu-container .menuwrapper .menu li > a').removeClass('hovered'); 4545}); 4546 4547 4548 4549/***************** Page Headers ******************/ 4550 4551var pageHeaderHeight;
4552var pageHeaderHeightCopy; 4553var pageHeadingHeight; 4554var extraSpaceFromResize = ($('#header-outer[data-header-resize="1"]').length > 0 && $('.nectar-box-roll').length == 0) ? 51 : 1; 4555//full screen header 4556function fullScreenHeaderInit(){ 4557 4558 pageHeaderHeight = parseInt($('#page-header-bg').attr('data-height')); 4559 pageHeaderHeightCopy = parseInt($('#page-header-bg').attr('data-height')); 4560 4561 if($('.fullscreen-header').length > 0) { 4562 4563 if($('#header-outer[data-transparency-option]').length > 0 && $('#header-outer').attr('data-transparency-option') != '0'){ 4564 var calculatedNum = (!$('body').hasClass('mobile')) ? $(window).height() : $(window).height() - parseInt($('#header-outer').height()) ; 4565 } else { 4566 var calculatedNum = (!$('body').hasClass('mobile')) ? $(window).height() - parseInt($('#header-space').height()) + extraSpaceFromResize : $(window).height() - parseInt($('#header-outer').height()) ; 4567 } 4568 var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar 4569 if($('.nectar-box-roll').length > 0) extraHeight = 0; 4570 pageHeaderHeight = calculatedNum - extraHeight; 4571 pageHeaderHeightCopy = calculatedNum - extraHeight; 4572 } 4573 4574 $('#page-header-bg').css('height',pageHeaderHeight+'px').removeClass('not-loaded'); 4575 setTimeout(function(){ $('#page-header-bg').css('overflow','visible') },800); 4576 4577} 4578 4579fullScreenHeaderInit(); 4580 4581function pageHeader(){ 4582 4583 //add loaded class 4584 $('#page-header-bg[data-animate-in-effect="zoom-out"]').addClass('loaded'); 4585 4586 var $scrollTop = $(window).scrollTop(); 4587 4588 //full screen header 4589 if($('.fullscreen-header').length > 0) { 4590 if($('#header-outer[data-transparency-option]').length > 0 && $('#header-outer').attr('data-transparency-option') != '0'){ 4591 var calculatedNum = (!$('body').hasClass('mobile')) ? $(window).height() : $(window).height() - parseInt($('#header-outer').height()) ; 4592 if($('body[data-permanent-transparent="1"]').length > 0) calculatedNum = $(window).height(); 4593 } else { 4594 var calculatedNum = (!$('body').hasClass('mobile')) ? $(window).height() - parseInt($('#header-space').height()) + extraSpaceFromResize : $(window).height() - parseInt($('#header-outer').height()) ; 4595 } 4596 var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar 4597 if($('.nectar-box-roll').length > 0) extraHeight = 0; 4598 pageHeaderHeight = calculatedNum - extraHeight; 4599 pageHeaderHeightCopy = calculatedNum - extraHeight; 4600 } 4601 4602 if( window.innerWidth < 1000 && window.innerWidth > 690 && !$('body').hasClass('salient_non_responsive') ) { 4603 var $multiplier = ($('.fullscreen-header').length > 0) ? 1 : 1.6; 4604 $('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px'); 4605 $('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px'); 4606 4607 } else if( window.innerWidth <= 690 && window.innerWidth > 480 && !$('body').hasClass('salient_non_responsive')) { 4608 var $multiplier = ($('.fullscreen-header').length > 0) ? 1 : 2.1; 4609 $('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px'); 4610 $('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px'); 4611 4612 } else if( window.innerWidth <= 480 && !$('body').hasClass('salient_non_responsive')) { 4613 var $multiplier = ($('.fullscreen-header').length > 0) ? 1 : 2.5; 4614 $('#page-header-bg').attr('data-height', pageHeaderHeightCopy/$multiplier).css('height',pageHeaderHeightCopy/$multiplier +'px'); 4615 $('#page-header-wrap').css('height',pageHeaderHeightCopy/$multiplier +'px'); 4616 4617 } else { 4618 $('#page-header-bg').attr('data-height', pageHeaderHeightCopy).css('height',pageHeaderHeightCopy +'px'); 4619 if($('.fullscreen-header').length > 0){ 4620 $('#page-header-wrap').css('height',pageHeaderHeightCopy +'px'); 4621 } else { 4622 $('#page-header-wrap').css('height',pageHeaderHeightCopy +'px'); 4623 } 4624 4625 if($('#page-header-bg[data-parallax="1"]').length == 0) $('#page-header-wrap').css('height',pageHeaderHeightCopy +'px'); 4626 } 4627 4628
4629 4630 if(!$('body').hasClass('mobile')){ 4631 4632 //recalc 4633 pageHeaderHeight = parseInt($('#page-header-bg').attr('data-height')); 4634 $('#page-header-bg .container > .row').css('top',0); 4635 var $divisionMultipler = ($('#header-outer[data-remove-border="true"]').length > 0) ? 2 : 1; 4636 4637 //center the heading 4638 pageHeadingHeight = $('#page-header-bg .col.span_6').height(); 4639 4640 if($('#header-outer[data-transparent-header="true"]').length > 0 && $('.fullscreen-header').length == 0) { 4641 $('#page-header-bg:not("[data-parallax=1]") .col.span_6').css('top', ((pageHeaderHeight+$('#header-space').height()/$divisionMultipler)/2) - (pageHeadingHeight/2)); 4642 } else { 4643 var $extraResizeHeight = ($('#header-outer[data-header-resize="1"]').length > 0) ? 22: 0; 4644 $('#page-header-bg:not("[data-parallax=1]") .col.span_6').css('top', (pageHeaderHeight/2) - (pageHeadingHeight/2) + $extraResizeHeight); 4645 } 4646 4647 //center portfolio filters 4648 $('#page-header-bg:not("[data-parallax=1]") .portfolio-filters').css('top', (pageHeaderHeight/2) + 2); 4649 4650 if($('#page-header-bg[data-parallax="1"] .span_6').css('opacity') > 0) { 4651 4652 if($('#header-outer[data-transparent-header="true"]').length > 0 && $('body.single-post .fullscreen-header').length == 0) { 4653 //center the parallax heading 4654 4655 $('#page-header-bg[data-parallax="1"] .span_6').css({ 4656 'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+60)), 4657 'top' : (((pageHeaderHeight+$('#header-space').height()/$divisionMultipler)/2) - (pageHeadingHeight/2)) +"px" 4658 }); 4659 4660 //center parllax portfolio filters 4661 $('#page-header-bg[data-parallax="1"] .portfolio-filters').css({ 4662 'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+75)), 4663 'top' : ($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px" 4664 }); 4665 } else { 4666 //center the parallax heading 4667 $('#page-header-bg[data-parallax="1"] .span_6').css({ 4668 'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+60)), 4669 'top' : ((pageHeaderHeight/2) - (pageHeadingHeight/2)) +10 +"px" 4670 }); 4671 4672 //center parllax portfolio filters 4673 $('#page-header-bg[data-parallax="1"] .portfolio-filters').css({ 4674 'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+75)), 4675 'top' : ($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px" 4676 }); 4677 } 4678 } 4679 } 4680 4681 else { 4682 //recalc 4683 pageHeaderHeight = parseInt($('#page-header-bg').attr('data-height')); 4684 4685 //center the heading 4686 var pageHeadingHeight = $('#page-header-bg .container > .row').height(); 4687 $('#page-header-bg .container > .row').css('top', (pageHeaderHeight/2) - (pageHeadingHeight/2) + 5); 4688 4689 } 4690 4691 4692 $('#page-header-bg .container > .row').css('visibility','visible'); 4693} 4694 4695var $pt_timeout = ($('body[data-ajax-transitions="true"]').length > 0 && $('#page-header-bg[data-animate-in-effect="slide-down"]').length > 0) ? 350 : 0; 4696setTimeout(function(){ pageHeader(); },$pt_timeout); 4697 4698 4699if($('#header-outer').attr('data-header-resize') == '' || $('#header-outer').attr('data-header-resize') == '0'){ 4700 $('#page-header-wrap').css('margin-top','0'); 4701} 4702 4703 4704function extractUrl(input) { 4705 return input.replace(/"/g,"").replace(/url\(|\)$/ig, ""); 4706} 4707 4708/***************** Parallax Page Headers ******************/ 4709if($('#page-header-bg[data-parallax="1"]').length > 0) { 4710 4711 //fadeIn 4712 4713 var img = new Image(); 4714 4715 var imgX, imgY, aspectRatio; 4716 var diffX, diffY; 4717 var pageHeadingHeight = $('#page-header-bg .col.span_6').height(); 4718 var pageHeaderHeight = parseInt($('#page-header-bg').attr('data-height')); 4719 var headerPadding2 = parseInt($('#header-outer').attr('data-padding'))*2; 4720 var wooCommerceHeader = ($('.demo_store').length > 0) ? 32 : 0 ; 4721 4722 4723 var $initialImgCheck = extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image')); 4724 4725 if ($initialImgCheck && $initialImgCheck.indexOf('.') !== -1) { 4726 img.onload = function() { 4727 pageHeaderInit(); 4728 } 4729
4730 img.src = extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image')); 4731 4732 } else { 4733 pageHeaderInit(); 4734 } 4735 4736 4737 4738 var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar 4739 4740 4741 if($('body[data-hhun="1"]').length > 0) $('#header-outer').addClass('parallax-contained'); 4742 4743 window.addEventListener('scroll', function(){ 4744 window.requestAnimationFrame(bindHeaderParallax); 4745 }, false); 4746 4747} 4748 4749 4750function bindHeaderParallax(){ 4751 4752 var $scrollTop = $(window).scrollTop(); 4753 var pageHeadingHeight = $('#page-header-bg .col.span_6').height(); 4754 4755 4756 if(!$('body').hasClass('mobile') && navigator.userAgent.match(/iPad/i) == null){ 4757 4758 var $multiplier1 = ($('body[data-hhun="1"]').length > 0) ? 0.40: 0.2; 4759 var $multiplier2 = ($('body[data-hhun="1"]').length > 0) ? 0.09: 0.14; 4760 var $parallaxHeaderHUN = ($('#header-outer[data-transparency-option="1"]').length > 0) ? 0.49: 0.4; 4761 4762 //calc bg pos 4763 //$('#page-header-bg[data-parallax="1"]').css({'top': ((- $scrollTop / 5)+logoHeight+headerPadding+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader) + 'px' }); 4764 if($('#page-header-bg .nectar-particles').length == 0 && $('#page-header-bg.out-of-sight').length == 0) { 4765 4766 $('#page-header-bg[data-parallax="1"]').css({ 'transform': 'translateY('+ $scrollTop*-$multiplier1 +'px)' }); 4767 4768 var multipler = ($('body').hasClass('single')) ? 1 : 2; 4769 $('#page-header-bg[data-parallax="1"] .span_6, #page-header-bg[data-parallax="1"][data-post-hs="default_minimal"] .author-section').css({ 4770 'opacity' : 1-($scrollTop/(pageHeaderHeight-60)) 4771 }); 4772 4773 $('#page-header-bg[data-parallax="1"] .span_6, body[data-button-style="rounded"] #page-header-bg[data-parallax="1"] .section-down-arrow, #page-header-bg[data-parallax="1"][data-post-hs="default_minimal"] .author-section').css({ 'transform': 'translateY('+ $scrollTop*- $multiplier2+'px)' }); 4774 4775 4776 if($('#page-header-bg[data-parallax="1"] .span_6').css('opacity') == 0){ 4777 $('#page-header-bg[data-parallax="1"] .span_6, #page-header-bg[data-parallax="1"] .portfolio-filters').hide(); 4778 } else { 4779 $('#page-header-bg[data-parallax="1"] .span_6, #page-header-bg[data-parallax="1"] .portfolio-filters').show(); 4780 } 4781 4782 if($('body[data-hhun="1"]').length > 0 && !$('#header-outer').hasClass('side-widget-open') && !$('#header-outer .slide-out-widget-area-toggle a').hasClass('animating')) { 4783 $('#header-outer.parallax-contained').css({ 'transform': 'translateY('+$scrollTop*-$parallaxHeaderHUN+'px)' }); 4784 } 4785 4786 4787 } 4788 else if($('#page-header-bg.out-of-sight').length == 0) { 4789 //alt parallax effect 4790 var multipler = ($('body').hasClass('single')) ? 1 : 2; 4791 $('#page-header-wrap .nectar-particles .fade-out').css({ 4792 'opacity' : 0+($scrollTop/(pageHeaderHeight+pageHeaderHeight*$multiplier)) 4793 }); 4794 } 4795 4796 4797 //hide elements to allow other parallax sections to work in webkit browsers 4798 if( ($scrollTop / (pageHeaderHeight + $('#header-space').height() + extraHeight)) > 1 ) { 4799 $('#page-header-bg, .nectar-particles, #page-header-bg .fade-out').css('visibility','hidden').hide().addClass('out-of-sight'); 4800 } 4801 else { 4802 $('#page-header-bg, .nectar-particles, #page-header-bg .fade-out').css('visibility','visible').show().removeClass('out-of-sight'); 4803 4804 //ensure header is centered 4805 pageHeaderHeight = parseInt($('#page-header-bg').attr('data-height')); 4806 $('#page-header-bg .container > .row').css('top',0); 4807 var $divisionMultipler = ($('#header-outer[data-remove-border="true"]').length > 0) ? 2 : 1; 4808 pageHeadingHeight = $('#page-header-bg .col.span_6').height(); 4809 4810 if($('#header-outer[data-transparent-header="true"]').length > 0 && $('body.single-post .fullscreen-header').length == 0) { 4811 //center the parallax heading 4812 $('#page-header-bg[data-parallax="1"] .span_6').css({ 4813 'top' : (((pageHeaderHeight+$('#header-space').height()/$divisionMultipler)/2) - (pageHeadingHeight/2)) +"px" 4814 }); 4815 4816 } else { 4817 //center the parallax heading
4818 $('#page-header-bg[data-parallax="1"] .span_6').css({ 4819 'top' : ((pageHeaderHeight/2) - (pageHeadingHeight/2)) +10 +"px" 4820 }); 4821 } 4822 } 4823 4824 4825 } 4826 4827} 4828 4829if($('#page-header-bg').length > 0) { 4830 var $initialImgCheckAscend = extractUrl($('#page-header-bg').css('background-image')); 4831 if ($initialImgCheckAscend && $initialImgCheckAscend.indexOf('.') !== -1) { 4832 $('#page-header-bg').addClass('has-bg'); 4833 } 4834} 4835 4836 4837function pageHeaderInit(){ 4838 4839 var wooCommerceHeader = ($('.demo_store').length > 0) ? 32 : 0 ; 4840 var centeredNavAltSpace = ($('#header-outer[data-format="centered-menu-under-logo"]').length > 0) ? $('header#top nav > .sf-menu').height() -20 : null; 4841 //transparent 4842 if($('#header-outer[data-transparent-header="true"]').length > 0) { 4843 $('#page-header-bg[data-parallax="1"]').css({'top': extraHeight+wooCommerceHeader }); 4844 } else { 4845 if($('body[data-header-resize="0"]').length == 0) $('#page-header-bg[data-parallax="1"]').css({'top': (logoHeight+headerPadding+centeredNavAltSpace+headerResizeOffExtra+extraHeight-extraDef+secondaryHeader+wooCommerceHeader) + 'px' }); 4846 } 4847 4848 //fade in header 4849 if($('#ajax-content-wrap').length == 0 || !$('body').hasClass('ajax-loaded')){ 4850 $('#page-header-bg[data-parallax="1"]').animate({ 'opacity' : 1},650,'easeInCubic'); 4851 } else if($('#ajax-content-wrap').length == 1) { 4852 $('#page-header-bg[data-parallax="1"]').css({ 'opacity' : 1}); 4853 } 4854 4855 //$('#page-header-wrap').css({'height' : pageHeaderHeight}); 4856 4857 //verify smooth scorlling 4858 if( $smoothCache == true && $(window).width() > 690 && $('body').outerHeight(true) > $(window).height() && Modernizr.csstransforms3d && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)){ niceScrollInit(); $(window).trigger('resize') } 4859 4860 /* $('#page-header-bg[data-parallax="1"] .span_6').css({ 4861 'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+60)) 4862 'top' : ((pageHeaderHeight/2) - (pageHeadingHeight/2)) +10 +"px" 4863 }); 4864 4865 $('#page-header-bg[data-parallax="1"] #portfolio-filters').css({ 4866 'opacity' : 1-($scrollTop/(pageHeaderHeight-($('#page-header-bg .col.span_6').height()*2)+75)), 4867 'top' : ($scrollTop*-0.10) + ((pageHeaderHeight/2)) - 7 +"px" 4868 }); */ 4869 4870 $('#page-header-bg[data-parallax="1"] .nectar-particles').append('<div class="fade-out" />'); 4871} 4872 4873 4874 4875 4876function nectarPageHeader() { 4877 4878 if($('#page-header-bg').length > 0) { 4879 fullScreenHeaderInit(); 4880 pageHeader(); 4881 } 4882 4883 4884 if($('#page-header-bg[data-parallax="1"]').length > 0) { 4885 4886 var img = new Image(); 4887 var $initialImgCheck = extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image')); 4888 4889 if ($initialImgCheck && $initialImgCheck.indexOf('.') !== -1) { 4890 img.onload = function() { 4891 pageHeaderInit(); 4892 4893 } 4894 4895 img.src = extractUrl($('#page-header-bg[data-parallax="1"]').css('background-image')); 4896 4897 } else { 4898 pageHeaderInit(); 4899 } 4900 4901 //bindHeaderParallax(); 4902 $('#page-header-bg[data-parallax="1"] .span_6').css({ 4903 'opacity' : 1 4904 }); 4905 4906 4907 4908 if (window.addEventListener) { 4909 window.addEventListener('scroll', function(){ 4910 requestAnimationFrame(bindHeaderParallax); 4911 }, false); 4912 } 4913 4914 } 4915 4916 if($('#page-header-bg').length > 0) { 4917 var $initialImgCheckAscend = extractUrl($('#page-header-bg').css('background-image')); 4918 if ($initialImgCheckAscend && $initialImgCheckAscend.indexOf('.') !== -1) { 4919 $('#page-header-bg').addClass('has-bg'); 4920 } 4921 } 4922} 4923 4924if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 || navigator.userAgent.match(/(iPod|iPhone|iPad)/)){ 4925 window.onunload = function(){ nectarPageHeader(); }; 4926} 4927 4928 4929/***************** header text effects *****************/ 4930 4931// rotate in 4932function pageHeaderTextEffectInit() { 4933 $('#page-header-bg').each(function(){ 4934 if($(this).attr('data-text-effect') == 'rotate_in') { 4935 var $topHeading = 'none'; 4936 4937 if($(this).find('.span_6 h1').length > 0) { 4938 $topHeading = 'h1'; 4939 } 4940 //else if ($(this).find('.span_6 h2').length > 0) { 4941 // $topHeading = 'h2'; 4942 //} 4943 4944 if($topHeading != 'none') { 4945 4946 var $selector = ($(this).find('.nectar-particles').length > 0) ? '.inner-wrap.shape-1' : '.span_6'; 4947 4948 $(this).find($selector).find($topHeading).addClass('top-heading').contents().filter(function () { 4949 return this.nodeType === 3 && typeof this.data != 'undefined' && this.data.replace(/\s+/, ""); 4950 }).wrap('<span class="wraped"></span>'); 4951 4952 $(this).find($selector).find('.wraped').each(function () { 4953 4954 textNode = $(this); 4955 4956 text = textNode.text().split(' '); 4957 replace = ''; 4958 4959 $.each(text, function (index, value) { 4960 if (value.replace(/\s+/, "")) { 4961 replace += '<span class="wraped"><span>' + value + '</span></span> '; 4962 } 4963 }); 4964 textNode.replaceWith($(replace)); 4965 4966 }); 4967 }//make sure suitable heading was found 4968 4969 }//tilt 4970 }); 4971 4972} 4973function pageHeaderTextEffect() { 4974 4975 if($('#page-header-bg .nectar-particles').length == 0 && $('#page-header-bg[data-text-effect="none"]').length == 0 || $('.nectar-box-roll').length > 0 && $('#page-header-bg .nectar-particles').length == 0) { 4976 4977 var $selector = ($('.nectar-box-roll').length == 0) ? '#page-header-bg .span_6' : '.nectar-box-roll .overlaid-content .span_6'; 4978 4979 $($selector).find('.wraped').each(function(i){ 4980 $(this).find('span').delay(i*370).transition({ rotateX: '0', 'opacity' : 1, y: 0},400,'easeOutQuad'); 4981 }); 4982 4983 setTimeout(function(){ 4984 4985 $($selector).find('.inner-wrap > *:not(.top-heading)').each(function(i){ 4986 $(this).delay(i*370).transition({ rotateX: '0', 'opacity' : 1, y: 0 },650,'easeOutQuad'); 4987 }); 4988 4989 $('.scroll-down-wrap').removeClass('hidden'); 4990 4991 }, $($selector).find('.wraped').length * 370); 4992 } 4993 4994} 4995var $effectTimeout = ($('#ajax-loading-screen').length > 0) ? 800 : 0; 4996pageHeaderTextEffectInit(); 4997if($('#page-header-bg .nectar-video-wrap video').length == 0) setTimeout(pageHeaderTextEffect,$effectTimeout); 4998 4999 5000 5001 5002 //submenu fix 5003 if($('header#top nav > ul.sf-menu ul').length > 0) { 5004 5005 var $midnightSubmenuTimeout; 5006 $('body').on('mouseover','#header-outer .midnightHeader .sf-with-ul, #header-outer .midnightHeader .cart-menu',function(){ 5007 5008 if($(this).parents('.midnightHeader').offset().top - $(window).scrollTop() < 50){ 5009 5010 $(this).parents('.midnightHeader').css({'z-index': '9999'}).addClass('overflow'); 5011 $(this).parents('.midnightInner').css('overflow','visible'); 5012 } 5013 }); 5014 $('body').on('mouseleave','#header-outer .midnightHeader',function(){ 5015 var $that = $(this); 5016 clearTimeout($midnightSubmenuTimeout); 5017 $midnightSubmenuTimeout = setTimeout(function(){ 5018 if(!$that.is(':hover')) { 5019 $that.css({'z-index': 'auto'}).removeClass('overflow'); 5020 $that.find('.midnightInner').css('overflow','hidden'); 5021 5022 } 5023 5024 },900); 5025 }); 5026 } 5027 5028 function midnightInit() { 5029 if( $('#header-outer[data-permanent-transparent="1"]').length > 0 && $('body[data-bg-header="true"]').length > 0) { 5030 $('#header-outer').midnight(); 5031 5032 //no menu 5033 if($('#header-outer[data-has-menu="false"]').length > 0) { 5034 //fix the pointer events 5035 //var enableHandler = false; 5036 5037 var $buttonsOffset = $('#header-outer header#top nav > ul.buttons').position(); 5038 if($('#header-outer #logo img').length > 0) { 5039 var $logoOffset = $('#header-outer #logo img:visible').position(); 5040 var $logoOffsetTop = $('#header-outer #logo img:visible').position().top; 5041 var $logoMargin = parseInt($('#header-outer #logo img:visible').css('margin-top')); 5042 var $logoWidth = $('#header-outer #logo img:visible').width(); 5043 } else { 5044 var $logoOffset = $('#header-outer .span_3 #logo:visible').offset(); 5045 var $logoOffsetTop = $('#header-outer .span_3 #logo:visible').offset().top - $(window).scrollTop(); 5046 var $logoMargin = parseInt($('#header-outer .span_3 #logo:visible').css('margin-top')); 5047 var $logoWidth = $('#header-outer #logo').width(); 5048 } 5049 5050 var $containerMargin = parseInt($('#header-outer header > .container').css('padding-left')); 5051 var $headerOffset = $('#header-outer').position(); 5052 //recalc offsets 5053 $(window).on('smartresize', function(){ 5054 if($('#header-outer #logo img').length > 0) { 5055 $logoMargin = parseInt($('#header-outer #logo img:visible').css('margin-top')); 5056 $logoOffset = $('#header-outer #logo img:visible').position(); 5057 $logoOffsetTop = $('#header-outer #logo img:visible').position().top; 5058 $logoWidth = $('#header-outer #logo img:visible').width(); 5059 } else { 5060 $logoMargin = parseInt($('#header-outer .span_3 #logo:visible').css('margin-top')); 5061 $logoOffset = $('#header-outer .span_3 #logo:visible').offset(); 5062 $logoOffsetTop = $('#header-outer .span_3 #logo:visible').offset().top - $(window).scrollTop(); 5063 $logoWidth = $('#header-outer #logo').width(); 5064 } 5065 $containerMargin = parseInt($('#header-outer header > .container').css('padding-left')); 5066 $buttonsOffset = $('#header-outer header#top nav > ul.buttons').position(); 5067 $headerOffset = $('#header-outer').position(); 5068 }); 5069 5070 $('body').mousemove(function(e){
5071 if($('body.mobile').length == 0) { 5072 5073 //hover over buttons || logo check 5074 if(e.clientX >= $buttonsOffset.left + $containerMargin && 5075 e.clientY >= $buttonsOffset.top && 5076 e.clientY <= $buttonsOffset.top + $headerOffset.top + $('#header-outer header#top nav > ul.buttons').height() || 5077 e.clientX <= $logoOffset.left + $containerMargin + $logoWidth && 5078 e.clientY >= $logoOffsetTop && 5079 e.clientY <= $logoOffsetTop + $logoMargin + $headerOffset.top + $('#header-outer #logo img:visible').height() ) { 5080 $('.midnightHeader, #header-outer').removeClass('no-pointer-events'); 5081 5082 } else { 5083 $('.midnightHeader, #header-outer').addClass('no-pointer-events'); 5084 } 5085 5086 5087 } else { 5088 $('.midnightHeader, #header-outer').removeClass('no-pointer-events'); 5089 } 5090 }); 5091 5092 5093 } 5094 5095 //using menu 5096 else if($('#header-outer[data-has-menu="true"]').length > 0) { 5097 5098 var $headerPos = $('header#top .container').position(); 5099 var $headerOffset = $('header#top .container').offset(); 5100 //recalc offsets 5101 $(window).on('smartresize', function(){ 5102 5103 $headerPos = $('header#top .container').position(); 5104 $headerOffset = $('header#top .container').offset(); 5105 5106 }); 5107 5108 $('body').mousemove(function(e){ 5109 if($('body.mobile').length == 0) { 5110 5111 //hover over buttons || logo check 5112 if(e.clientX >= $headerOffset.left && 5113 e.clientY >= $headerPos.top && 5114 e.clientY <= $('header#top .container .row').height()) { 5115 $('.midnightHeader, #header-outer').removeClass('no-pointer-events'); 5116 } else if($('li.sfHover').length == 0) { 5117 $('.midnightHeader, #header-outer').addClass('no-pointer-events'); 5118 } 5119 5120 5121 } else { 5122 $('.midnightHeader, #header-outer').removeClass('no-pointer-events'); 5123 } 5124 }); 5125 5126 } 5127 } 5128 } 5129 5130 5131 5132//box roll 5133function getScrollbarWidth() { 5134 var outer = document.createElement("div"); 5135 outer.style.visibility = "hidden"; 5136 outer.style.width = "100px"; 5137 outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps 5138 5139 document.body.appendChild(outer); 5140 5141 var widthNoScroll = outer.offsetWidth; 5142 // force scrollbars 5143 outer.style.overflow = "scroll"; 5144 5145 // add innerdiv 5146 var inner = document.createElement("div"); 5147 inner.style.width = "100%"; 5148 outer.appendChild(inner); 5149 5150 var widthWithScroll = inner.offsetWidth; 5151 5152 // remove divs 5153 outer.parentNode.removeChild(outer); 5154 5155 return widthNoScroll - widthWithScroll; 5156} 5157 5158 5159function boxRollInit() { 5160 if($('.nectar-box-roll').length > 0) { 5161 5162 $('body').attr('data-scrollbar-width',getScrollbarWidth()); 5163 5164 $('body, html, #ajax-content-wrap, .container-wrap, .blurred-wrap').addClass('no-scroll'); 5165 $('body,html').stop().animate({ scrollTop:0 },0); 5166 $('.container-wrap').css('opacity',0).addClass('no-transform-animation-bottom-out').addClass('bottomBoxOut'); 5167 //keep loading icon centered if scrollbar is going away 5168 if($('.mobile').length == 0) $('#ajax-loading-screen .loading-icon > span').css({ 'left' : '-'+getScrollbarWidth()/2 +'px'}); 5169 5170 //change content pos 5171 var $overlaid = $('#page-header-bg .overlaid-content').clone(); 5172 var $scrollDownOverlaid = $('.scroll-down-wrap').clone(); 5173 $('#page-header-bg').removeAttr('data-midnight'); 5174 $('#page-header-bg .overlaid-content, #page-header-bg .scroll-down-wrap').remove(); 5175 $('.nectar-box-roll').append($overlaid).attr('data-midnight','light'); 5176 $('.overlaid-content').append($scrollDownOverlaid); 5177 5178 5179 nectarBoxRollContentHeight(); 5180 setTimeout(function() { pageLoadHash(); },700); 5181 } else { 5182 $('#ajax-content-wrap, .blurred-wrap').addClass('at-content'); 5183 $('body, html, #ajax-content-wrap, .container-wrap, .blurred-wrap').removeClass('no-scroll'); 5184 $('.container-wrap').css('opacity',1).removeClass('no-transform-animation-bottom-out').removeClass('bottomBoxOut').removeClass('bottomBoxIn'); 5185 perspect = 'not-rolled'; 5186 } 5187} 5188boxRollInit(); 5189 5190function nectarBoxRollContentHeight() { 5191 /*if($('#header-outer[data-transparent-header="true"]').length == 0 && $('.mobile').length == 0) { 5192 $('.nectar-box-roll').css('top',$('#header-space').height()); 5193 } else { 5194 $('.nectar-box-roll').css('top','0'); 5195 }*/ 5196 5197 if($('#header-outer[data-transparent-header="true"]').length == 0) { 5198 $('.nectar-box-roll .overlaid-content, .nectar-box-roll .canvas-bg, .container-wrap').css({'height':window.innerHeight - $('#header-space').height(), 'min-height':window.innerHeight - $('#header-space').height() }); 5199 if($('.mobile').length == 0) { $('#ajax-content-wrap').css('margin-top',$('#header-space').height()); $('#slide-out-widget-area.fullscreen').css('margin-top','-'+$('#header-space').height()+'px'); } 5200 else $('#ajax-content-wrap, #slide-out-widget-area.fullscreen').css('margin-top','0'); 5201 } else { 5202 $('.nectar-box-roll .overlaid-content, .nectar-box-roll .canvas-bg, .container-wrap').css('height',window.innerHeight); 5203 } 5204} 5205 5206if($('.nectar-box-roll').length > 0) $(window).on('resize',nectarBoxRollContentHeight); 5207 5208 5209var perspect = 'not-rolled'; 5210var animating = 'false'; 5211function boxRoll(e,d) { 5212 5213 if($('#slide-out-widget-area.open').length > 0) return false; 5214 if( $('.nectar-box-roll canvas').length > 0 && $('.nectar-box-roll canvas[data-loaded="true"]').length == 0) return false; 5215 5216 if(perspect == 'not-rolled' && animating == 'false' && d == -1) { 5217 perspect = 'rolled'; 5218 animating = 'true'; 5219 $('body').addClass('box-animating').addClass('box-perspective-rolled').addClass('box-rolling'); 5220 5221 $('.nectar-box-roll #page-header-bg').removeClass('topBoxIn').addClass('topBoxOut').css('will-change','transform'); 5222 5223 $('.nectar-box-roll .overlaid-content').removeClass('topBoxIn2').removeClass('topBoxIn').addClass('topBoxOut2').css('will-change','transform'); 5224 5225 $('.container-wrap').removeClass('bottomBoxOut').addClass('bottomBoxIn').removeClass('no-transform-animation-bottom-out').addClass('nectar-box-roll-class').css('will-change','transform'); 5226 if($('#header-outer[data-transparent-header="true"]').length == 0) { 5227 $('.container-wrap').css({'height':$(window).height() - $('#header-space').height(), 'opacity': 1}); 5228 $('#slide-out-widget-area.fullscreen').css('margin-top','0px'); 5229 } else { 5230 $('.container-wrap').css({'height':$(window).height(), 'opacity': 1}); 5231 } 5232 5233 5234 $('.nectar-slider-wrap').css({'opacity':0}); 5235 5236 updateRowRightPadding(d); 5237 pauseVideoBG(); 5238 5239 //old browser workaround 5240 var timeout1 = 1220; 5241 var timeout2 = 1650; 5242 var timeout3 = 1700; 5243 var timeout4 = 1350; 5244 if( $('html.no-cssanimations').length > 0) { 5245 timeout1 = 1; 5246 timeout2 = 1; 5247 timeout3 = 1; 5248 timeout4 = 1; 5249 } 5250 5251 $('.container-wrap').css('padding-right',$('body').attr('data-scrollbar-width') + 'px'); 5252 setTimeout(function(){ 5253 $('#header-outer, #wpadminbar, .cart-outer .cart-menu, .midnightHeader .midnightInner').animate({'padding-right': $('body').attr('data-scrollbar-width')},250); 5254 $('.nectar-box-roll .canvas-bg').addClass('out-of-sight'); 5255 if($('#header-outer[data-permanent-transparent="1"]').length == 0) $('#header-outer').removeClass('transparent'); 5256 5257 if($('body.mobile').length > 0) $('.nectar-box-roll').css({'z-index':'1'}); 5258 },timeout1); 5259 setTimeout(function(){ 5260 updateRowRightPadding(1); 5261 $('body,html,#ajax-content-wrap, .container-wrap, .blurred-wrap').removeClass('no-scroll'); 5262 $('#ajax-content-wrap, .blurred-wrap').addClass('at-content'); 5263 $('.container-wrap, #footer-outer').removeClass('bottomBoxIn').removeClass('nectar-box-roll-class').addClass('auto-height'); 5264 $('#header-outer, #wpadminbar, .container-wrap, .cart-outer .cart-menu, .midnightHeader .midnightInner').stop().css('padding-right',0); 5265 5266 if( $smoothActive == 1 && $(window).width() > 690 && Modernizr.csstransforms3d && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ 5267 niceScrollInit(); 5268 } 5269 5270 $('.nectar-box-roll').css({'z-index':'-1000'}).transition({'y': '-200%'},0); 5271 $('.nectar-box-roll canvas').hide(); 5272 $('body').removeClass('box-rolling'); 5273 $('.nectar-slider-wrap').transition({'opacity':1},600,'easeOutCubic'); 5274 5275 $('.nectar-box-roll #page-header-bg, .nectar-box-roll .overlaid-content, .container-wrap').css('will-change','auto'); 5276 if($waypointsBound == false) waypoints(); 5277 },timeout2); 5278 5279 //fadeIn 5280 setTimeout(function(){ 5281 $('.container-wrap .main-content > .row > div > div[class*="col"]').css({'opacity':1}); 5282 },timeout4); 5283 5284 setTimeout(function(){ 5285 animating ='false'; 5286 $('body').removeClass('box-animating'); 5287 },timeout3); 5288 5289 //header position when transparent nav was used 5290 if($('#header-outer[data-permanent-transparent="1"]').length == 0 && $('.mobile').length == 0 && $('#header-outer[data-transparent-header="true"]').length != 0) { 5291 $('#ajax-content-wrap').transition({'margin-top':$('#header-outer').outerHeight(true) + $('#header-outer').offset().top},2000,'easeInOutQuad'); 5292 } 5293 /*if($('#header-outer[data-transparent-header="true"]').length == 0 && $('.mobile').length == 0) { 5294 $('.nectar-box-roll').transition({'top': 0},2000,'easeInOutQuad'); 5295 }*/ 5296 5297 5298 //remove header if not fixed 5299 if($('.mobile #header-outer[data-permanent-transparent="1"]').length > 0 && $('.mobile #header-outer[data-mobile-fixed="false"]').length == 1) $('#header-outer').transition({'y':'-100%'},400,'easeOutCubic'); 5300 5301 } 5302 5303 else if(perspect == 'rolled' && animating == 'false' && d == 1 && $(window).scrollTop() < 100) { 5304 5305 $('.container-wrap').removeClass('auto-height'); 5306 if($('#header-outer[data-transparent-header="true"]').length == 0) { 5307 $('.container-wrap').css({'height':$(window).height() - $('#header-space').height(), 'opacity': 1}); 5308 } else { 5309 $('.container-wrap').css({'height':$(window).height(), 'opacity': 1}); 5310 } 5311 5312 $('#footer-outer').removeClass('auto-height'); 5313 $('body').addClass('box-rolling'); 5314 5315 perspect = 'not-rolled'; 5316 animating = 'true'; 5317 $('body').addClass('box-animating').addClass('box-perspective-not-rolled'); 5318 5319 $('#header-outer, #wpadminbar, .container-wrap, .cart-outer .cart-menu, .midnightHeader .midnightInner').css('padding-right',$('body').attr('data-scrollbar-width') + 'px'); 5320 $('.nectar-slider-wrap').transition({'opacity':0},600,'easeOutCubic'); 5321 $('.container-wrap .main-content > .row > div > div[class*="col"]').stop(true).css({'opacity':0}); 5322 setTimeout(function(){ 5323 $('#header-outer, #wpadminbar, .cart-outer .cart-menu, .midnightHeader .midnightInner').animate({'padding-right': 0},250); 5324 $('.nectar-box-roll .canvas-bg').removeClass('out-of-sight'); 5325 resizeVideoToCover(); 5326 //header position when transparent nav was used 5327 if($('#header-outer[data-transparent-header="true"]').length != 0) { 5328 $('#ajax-content-wrap').stop(true,true).transition({'margin-top':0},2000,'easeInOutCubic'); 5329 } else { 5330 if($('.mobile').length == 0) $('#slide-out-widget-area.fullscreen').css('margin-top','-'+$('#header-space').height()+'px'); 5331 } 5332 //if($('#header-outer[data-permanent-transparent="1"]').length == 0 && $('.mobile').length == 0 ) $('.nectar-box-roll').transition({'top': $('#header-space').height() },2000,'easeInOutQuad'); 5333 5334 },30); 5335 5336 //old browser workaround 5337 var timeout1 = 1700; 5338 var timeout2 = 1600; 5339 var timeout3 = 1300; 5340 if( $('html.no-cssanimations').length > 0) { 5341 timeout1 = 1; 5342 timeout2 = 1; 5343 timeout3 = 1; 5344 } 5345 5346 if($('body.mobile').length > 0) { 5347 setTimeout(function(){ 5348 $('.nectar-box-roll').css('z-index','1000'); 5349 },timeout3); 5350 } else { 5351 $('.nectar-box-roll').css('z-index','1000'); 5352 } 5353 5354 updateRowRightPadding(d); 5355 removeNiceScroll(); 5356 $('.nectar-box-roll').transition({'y': '0'},0); 5357 $('.nectar-box-roll canvas').show(); 5358 setTimeout(function(){ 5359 updateRowRightPadding(1); 5360 animating ='false'; 5361 $('body').removeClass('box-animating'); 5362 $('#page-header-bg').removeClass('topBoxIn'); 5363 $('.overlaid-content').removeClass('topBoxIn2'); 5364 $('body').removeClass('box-rolling'); 5365 resumeVideoBG(); 5366 $('.nectar-box-roll #page-header-bg, .nectar-box-roll .overlaid-content, .container-wrap').css('will-change','auto'); 5367 },timeout1); 5368 5369 setTimeout(function(){ 5370 if($('.mobile #header-outer[data-permanent-transparent="1"]').length > 0 && $('.mobile #header-outer[data-mobile-fixed="false"]').length == 1) $('#header-outer').transition({'y':'0%'},400,'easeOutCubic'); 5371 },timeout2); 5372 5373 $('body,html,#ajax-content-wrap, .container-wrap, .blurred-wrap').addClass('no-scroll'); 5374 $('#ajax-content-wrap, .blurred-wrap').removeClass('at-content'); 5375 $('.container-wrap').addClass('nectar-box-roll-class'); 5376 $('.nectar-box-roll #page-header-bg').removeClass('topBoxOut').addClass('topBoxIn').css('will-change','transform'); 5377 5378 $('.container-wrap').removeClass('bottomBoxIn').addClass('bottomBoxOut').css('will-change','transform'); 5379 5380 if($('#header-outer[data-transparent-header="true"]').length > 0 && $('#header-outer[data-permanent-transparent="1"]').length == 0) $('#header-outer').addClass('transparent'); 5381 5382 $('.nectar-box-roll .overlaid-content').removeClass('topBoxOut2').removeClass('topBoxOut').addClass('topBoxIn2').css('will-change','transform'); 5383 5384 if($('#header-outer[data-header-resize="1"]').length > 0) { bigNav(); } 5385 5386 $('.nectar-box-roll .trigger-scroll-down').removeClass('hovered'); 5387 } 5388 5389
5390} 5391 5392function boxScrollEvent(event, delta) { 5393 if($('#slide-out-widget-area.open.fullscreen').length > 0) return false; 5394 boxRoll(event,delta); 5395} 5396 5397function boxRollMouseWheelInit() { 5398 if($('.nectar-box-roll').length > 0) { 5399 $('body').on("mousewheel", boxScrollEvent); 5400 } else { 5401 $('body').off("mousewheel", boxScrollEvent); 5402 } 5403} 5404 5405boxRollMouseWheelInit(); 5406 5407$('body').on('click','.nectar-box-roll .section-down-arrow',function(){ 5408 boxRoll(null,-1); 5409 $(this).addClass('hovered'); 5410 setTimeout(function(){ $('.nectar-box-roll .section-down-arrow').removeClass('hovered'); },2000); 5411 return false; 5412}); 5413 5414 5415 5416function updateRowRightPadding(d){ 5417 $('.wpb_row.full-width-section').each(function(){ 5418 if($(this).hasClass('extraPadding') && d == 1) { 5419 $(this).css('padding-right',parseInt($(this).css('padding-right')) - parseInt($('body').attr('data-scrollbar-width')) + 'px' ).removeClass('extraPadding'); 5420 } else { 5421 $(this).css('padding-right',parseInt($('body').attr('data-scrollbar-width')) + parseInt($(this).css('padding-right')) + 'px' ).addClass('extraPadding'); 5422 } 5423 }); 5424 $('.wpb_row.full-width-content').each(function(){ 5425 if($(this).find('.row-bg.using-image').length == 0) { 5426 if($(this).hasClass('extraPadding') && d == 1) { 5427 $(this).find('.row-bg').css('width',parseInt($(this).width()) - parseInt($('body').attr('data-scrollbar-width')) + 'px' ).removeClass('extraPadding'); 5428 } else { 5429 $(this).find('.row-bg').css('width',parseInt($('body').attr('data-scrollbar-width')) + $(this).width() + 'px' ).addClass('extraPadding'); 5430 } 5431 } 5432 }); 5433} 5434 5435function pauseVideoBG() { 5436 if($('.nectar-box-roll video').length > 0) $('.nectar-box-roll video')[0].pause(); 5437} 5438function resumeVideoBG() { 5439 if($('.nectar-box-roll video').length > 0) $('.nectar-box-roll video')[0].play(); 5440} 5441 5442//touch 5443if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) && $('.nectar-box-roll').length > 0) { 5444 $('body').swipe({ 5445 swipeStatus: function(event, phase, direction, distance, duration, fingers) { 5446 if($('#slide-out-widget-area.open').length > 0) return false; 5447 if(direction == 'up') { 5448 boxRoll(null,-1); 5449 if($('#ajax-content-wrap.no-scroll').length == 0) $('body').swipe("option", "allowPageScroll", 'vertical'); 5450 } else if(direction == "down" && $(window).scrollTop() == 0) { 5451 boxRoll(null,1); 5452 $('body').swipe("option", "allowPageScroll", 'auto'); 5453 } 5454 } 5455 }); 5456 5457} 5458 5459function removeNiceScroll() { 5460 if($().niceScroll && $("html").getNiceScroll()){ 5461 var nice = $("html").getNiceScroll(); 5462 nice.stop(); 5463 5464 $('html').removeClass('no-overflow-y'); 5465 $('.nicescroll-rails').hide(); 5466 if($('#boxed').length == 0){ 5467 $('body, body #header-outer, body #header-secondary-outer, body #search-outer, .midnightHeader .midnightInner').css('padding-right','0px'); 5468 } else if($('body[data-ext-responsive="true"]').length == 0 ) { 5469 $('body').css('padding-right','0px'); 5470 } 5471 5472 $('body').attr('data-smooth-scrolling','0'); 5473 } 5474 } 5475//called after box roll 5476$waypointsBound = false; 5477function waypoints() { 5478 colAndImgAnimations(); 5479 progressBars(); 5480 clientsFadeIn(); 5481 svgAnimations(); 5482 milestoneInit(); 5483 nectar_fancy_ul_init(); 5484 headerRowColorInheritInit(); 5485 morphingOutlines(); 5486 $waypointsBound = true; 5487} 5488 5489 5490 5491/***************** WooCommerce Cart *****************/ 5492var timeout; 5493var productToAdd; 5494 5495//notification 5496$('body').on('click','.product .add_to_cart_button', function(){ 5497 productToAdd = $(this).parents('li').find('h3').text(); 5498 $('#header-outer .cart-notification span.item-name').html(productToAdd); 5499 5500 //if($('.cart-menu-wrap').hasClass('first-load')) $('.cart-menu-wrap').removeClass('first-load').addClass('static'); 5501}); 5502 5503//notification hover 5504$('body').on('mouseenter','#header-outer .cart-notification',function(){ 5505 $(this).fadeOut(400); 5506 $('#header-outer .widget_shopping_cart').stop(true,true).fadeIn(300); 5507 $('#header-outer .cart_list').stop(true,true).fadeIn(300); 5508 clearTimeout(timeout); 5509}); 5510 5511//cart dropdown 5512$('#header-outer div.cart-outer').hoverIntent(function(){ 5513 $('#header-outer .widget_shopping_cart').stop(true,true).fadeIn(300); 5514 $('#header-outer .cart_list').stop(true,true).fadeIn(300); 5515 clearTimeout(timeout); 5516 $('#header-outer .cart-notification').fadeOut(300);
5517}); 5518 5519 5520$('body').on('mouseleave','#header-outer div.cart-outer',function(){ 5521 var $that = $(this); 5522 setTimeout(function(){ 5523 if(!$that.is(':hover')){ 5524 $('#header-outer .widget_shopping_cart').stop(true,true).fadeOut(300); 5525 $('#header-outer .cart_list').stop(true,true).fadeOut(300); 5526 } 5527 },100); 5528}); 5529 5530$('body').on('added_to_cart', shopping_cart_dropdown_show); 5531$('body').on('added_to_cart', shopping_cart_dropdown); 5532 5533function shopping_cart_dropdown() { 5534 5535 if(!$('.widget_shopping_cart .widget_shopping_cart_content .cart_list .empty').length && $('.widget_shopping_cart .widget_shopping_cart_content .cart_list').length > 0 ) { 5536 $('.cart-menu-wrap').addClass('has_products'); 5537 $('header#top nav > ul, #search-outer #search #close a').addClass('product_added'); 5538 5539 if(!$('.cart-menu-wrap').hasClass('static')) $('.cart-menu-wrap').addClass('first-load'); 5540 5541 //nectar slider nav directional effect 5542 if($('#header-outer').hasClass('directional-nav-effect') && $('#header-outer .cart-icon-wrap .dark').length == 0 && $('body.ascend').length > 0){ 5543 $('#header-outer .cart-outer .cart-icon-wrap').each(function(){ 5544 $(this).find('> i, > span.light, > span.dark, > span.original').remove(); 5545 $(this).append('<span class="dark"><span><i class="icon-salient-cart"></i></span></span><span class="light"><span><i class="icon-salient-cart"></i></span></span><span class="original"><span><i class="icon-salient-cart"></i></span></span>'); 5546 $(this).find('.original').attr('data-w',$(this).find('span.original').width()+1); 5547 }); 5548 } 5549 } 5550 5551} 5552 5553 5554function shopping_cart_dropdown_show(e) { 5555 5556 clearTimeout(timeout); 5557 5558 if(!$('.widget_shopping_cart .widget_shopping_cart_content .cart_list .empty').length && $('.widget_shopping_cart .widget_shopping_cart_content .cart_list').length > 0 && typeof e.type != 'undefined' ) { 5559 //before cart has slide in 5560 if(!$('#header-outer .cart-menu-wrap').hasClass('has_products')) { 5561 setTimeout(function(){ $('#header-outer .cart-notification').fadeIn(400); },400); 5562 } 5563 else if(!$('#header-outer .cart-notification').is(':visible')) { 5564 $('#header-outer .cart-notification').fadeIn(400); 5565 } else { 5566 $('#header-outer .cart-notification').show(); 5567 } 5568 timeout = setTimeout(hideCart,2700); 5569 5570 $('.cart-menu a, .widget_shopping_cart a').addClass('no-ajaxy'); 5571 } 5572} 5573 5574function hideCart() { 5575 $('#header-outer .cart-notification').stop(true,true).fadeOut(); 5576} 5577 5578function checkForWooItems(){ 5579 var checkForCartItems = setInterval(shopping_cart_dropdown,250); 5580 setTimeout(function(){ clearInterval(checkForCartItems); },4500); 5581} 5582checkForWooItems(); 5583 5584var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar 5585var secondaryHeader = ($('#header-outer').attr('data-using-secondary') == '1') ? 32 : 0 ; 5586function searchFieldCenter(){ 5587 $('#search-outer').css('top',$('#header-outer').outerHeight() + extraHeight + secondaryHeader); 5588 $('#search-outer > #search #search-box').css('top',($(window).height()/2) - ($('#search-outer > #search input').height()/2) - $('#header-outer').outerHeight() ); 5589} 5590 5591//text on hover effect 5592$('body').on('mouseover','.text_on_hover .product-wrap',function(){ 5593 $(this).parent().addClass('hovered'); 5594 //if($(this).find('.star-rating span').length > 0) $(this).find('.star-rating span').stop().animate({ width: $(this).find('.star-rating span').attr('data-width') },400,'easeOutCirc'); 5595}); 5596$('body').on('mouseover','.text_on_hover > a:first-child',function(){ 5597 $(this).parent().addClass('hovered'); 5598}); 5599 5600$('body').on('mouseout','.text_on_hover .product-wrap',function(){ 5601 $(this).parent().removeClass('hovered'); 5602 //if($(this).find('.star-rating span').length > 0) $(this).find('.star-rating span').stop().animate({ width: $(this).find('.star-rating span').attr('data-width') - 40 },500); 5603}); 5604$('body').on('mouseout','.text_on_hover > a:first-child',function(){ 5605 $(this).parent().removeClass('hovered'); 5606}); 5607 5608/* 5609$('.text_on_hover.product .star-rating span').each(function(){ 5610 $(this).attr('data-width',$(this).width()); 5611 $(this).css('width', $(this).attr('data-width') - 40); 5612});*/ 5613 5614
5615/***************** Search ******************/ 5616 var $placeholder = $('#search input[type=text]').attr('data-placeholder'); 5617 var logoHeight = parseInt($('#header-outer').attr('data-logo-height')); 5618 5619 ////search box event 5620 $('body').on('click', '#search-btn a', function(){ return false; }); 5621 $('body').on('mousedown', '#search-btn a:not(.inactive)', function(){ 5622 5623 if($(this).hasClass('open-search')) { return false; } 5624 5625 if($('body').hasClass('ascend')){ 5626 $('#search-outer > #search form, #search-outer #search .span_12 span').css('opacity',0); 5627 $('#search-outer > #search form').css('bottom','10px'); 5628 $('#search-outer #search .span_12 span').css('top','10px'); 5629 $('#search-outer').show(); 5630 $('#search-outer').stop().transition({scale: '1,0', 'opacity': 1},0).transition({ scale: '1,1'},400,'easeInOutCubic'); 5631 5632 $('#search-outer > #search form').delay(400).animate({'opacity':1, 'bottom':0},'easeOutCirc'); 5633 $('#search-outer #search .span_12 span').delay(470).animate({'opacity':1, 'top':0},'easeOutCirc'); 5634 5635 } else { 5636 $('#search-outer').stop(true).fadeIn(600,'easeOutExpo'); 5637 } 5638 5639 $('body:not(.ascend) #search-outer > #search input[type="text"]').css({ 5640 'top' : $('#search-outer').height()/2 - $('#search-outer > #search input[type="text"]').height()/2 5641 }); 5642 5643 setTimeout(function(){ 5644 5645 $('#search input[type=text]').focus(); 5646 5647 if($('#search input[type=text]').attr('value') == $placeholder){ 5648 $('#search input[type=text]').setCursorPosition(0); 5649 } 5650 5651 },300); 5652 5653 //ascend 5654 if($('body').hasClass('ascend')){ 5655 searchFieldCenter(); 5656 } 5657 5658 $(this).toggleClass('open-search'); 5659 5660 //close slide out widget area 5661 $('.slide-out-widget-area-toggle a.open:not(.animating)').trigger('click'); 5662 5663 return false; 5664 }); 5665 5666 $('body').on('keydown','#search input[type=text]',function(){ 5667 if($(this).attr('value') == $placeholder){ 5668 $(this).attr('value', ''); 5669 } 5670 }); 5671 5672 $('body').on('keyup','#search input[type=text]',function(){ 5673 if($(this).attr('value') == ''){ 5674 $(this).attr('value', $placeholder); 5675 $(this).setCursorPosition(0); 5676 } 5677 }); 5678 5679 5680 ////close search btn event 5681 $('body').on('click','#close',function(){ 5682 closeSearch(); 5683 $('#search-btn a').removeClass('open-search'); 5684 return false; 5685 }); 5686 5687 //if user clicks away from the search close it 5688 $('body').on('blur','#search-box input[type=text]',function(e){ 5689 closeSearch(); 5690 $('#search-btn a').removeClass('open-search'); 5691 }); 5692 5693 5694 function closeSearch(){ 5695 if($('body').hasClass('ascend')){ 5696 $('#search-outer').stop().transition({'opacity' :0},300,'easeOutCubic'); 5697 $('#search-btn a').addClass('inactive'); 5698 setTimeout(function(){ $('#search-outer').hide(); $('#search-btn a').removeClass('inactive'); },300); 5699 } else { 5700 $('#search-outer').stop(true).fadeOut(450,'easeOutExpo'); 5701 } 5702 } 5703 5704 5705 //mobile search 5706 $('body').on('click', '#mobile-menu #mobile-search .container a#show-search',function(){ 5707 $('#mobile-menu .container > ul').slideUp(500); 5708 return false; 5709 }); 5710 5711/***************** Nav ******************/ 5712 5713 var logoHeight = parseInt($('#header-outer').attr('data-logo-height')); 5714 var headerPadding = parseInt($('#header-outer').attr('data-padding')); 5715 var usingLogoImage = $('#header-outer').attr('data-using-logo'); 5716 5717 if( isNaN(headerPadding) || headerPadding.length == 0 ) { headerPadding = 28; } 5718 if( isNaN(logoHeight) || usingLogoImage.length == 0 ) { usingLogoImage = false; logoHeight = 30;} 5719 5720 //inital calculations 5721 function headerInit() { 5722 5723 $('#header-outer #logo img').css({ 5724 'height' : logoHeight, 5725 }); 5726 5727 $('#header-outer').css({ 5728 'padding-top' : headerPadding 5729 }); 5730 5731 if($('body.mobile').length == 0) { 5732 $('header#top nav > ul > li > a').css({ 5733 'padding-bottom' : Math.floor( ((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding), 5734 'padding-top' : Math.floor( (logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)) 5735 }); 5736 } 5737 5738 if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) { 5739 $('#header-outer .cart-menu').css({
5740 'padding-bottom' : Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding), 5741 'padding-top' : Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding) 5742 }); 5743 } else { 5744 $('#header-outer .cart-menu').css({ 5745 'padding-bottom' : Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding + logoHeight/2 + 7), 5746 'padding-top' : Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding + logoHeight/2 + 7) 5747 }); 5748 } 5749 5750 5751 $('header#top nav > ul li#search-btn, header#top nav > ul li.slide-out-widget-area-toggle').css({ 5752 'padding-bottom' : (logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2), 5753 'padding-top' : (logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) 5754 }); 5755 5756 if($('body.ascend ').length > 0 && $('#header-outer[data-full-width="true"]').length > 0) { 5757 $('header#top nav > ul li#search-btn, header#top nav > ul li.slide-out-widget-area-toggle').css({ 5758 'padding-top': 0, 5759 'padding-bottom': 0 5760 }); 5761 5762 $('header#top nav > ul.buttons').css({ 5763 'margin-top' : - headerPadding, 5764 'height' : Math.floor(logoHeight + headerPadding*2) -1 5765 }); 5766 5767 $('header#top nav > ul li#search-btn a, header#top nav > ul li.slide-out-widget-area-toggle a').css({ 5768 'visibility' : 'visible', 5769 'padding-top': Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding), 5770 'padding-bottom': Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding) 5771 }); 5772 } 5773 5774 $('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').css({ 5775 'top' : $('header#top nav > ul > li > a').outerHeight() 5776 }); 5777 5778 5779 setTimeout(function(){ 5780 $('body:not(.ascend) #search-outer #search-box .ui-autocomplete').css({ 5781 'top': parseInt($('#header-outer').outerHeight())+'px' 5782 }); 5783 },1000); 5784 5785 $('body:not(.ascend) #search-outer #search-box .ui-autocomplete').css({ 5786 'top': parseInt($('#header-outer').outerHeight())+'px' 5787 }); 5788 5789 //header space 5790 if($('.nectar-parallax-scene.first-section').length == 0) { 5791 5792 if($('#header-outer').attr('data-using-secondary') == '1'){ 5793 if($('#header-outer[data-mobile-fixed="false"]').length > 0 || $('body.mobile').length == 0 ) { 5794 $('#header-space').css('height', parseInt($('#header-outer').outerHeight()) + $('#header-secondary-outer').height()); 5795 5796 } else { 5797 $('#header-space').css('height', parseInt($('#header-outer').outerHeight())); 5798 5799 } 5800 5801 } else { 5802 5803 $('#header-space').css('height', $('#header-outer').outerHeight() ); 5804 } 5805 } 5806 5807 $('#header-outer .container, #header-outer .cart-menu').css('visibility','visible'); 5808 5809 if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) { 5810 $('body:not(.ascend) #search-outer, #search .container').css({ 5811 'height' : logoHeight + headerPadding*2 5812 }); 5813 5814 $('body:not(.ascend) #search-outer > #search input[type="text"]').css({ 5815 'font-size' : 43, 5816 'height' : '59px', 5817 'top' : ((logoHeight + headerPadding*2)/2) - $('#search-outer > #search input[type="text"]').height()/2 5818 }); 5819 5820 $('body:not(.ascend) #search-outer > #search #close a').css({ 5821 'top' : ((logoHeight + headerPadding*2)/2) - 8 5822 }); 5823 } else { 5824 $('body:not(.ascend) #search-outer, #search .container').css({ 5825 'height' : logoHeight + headerPadding*2 + logoHeight + 17 5826 }); 5827 5828 $('body:not(.ascend) #search-outer > #search input[type="text"]').css({ 5829 'font-size' : 43, 5830 'height' : '59px', 5831 'top' : ((logoHeight + headerPadding*2)/2) - ($('#search-outer > #search input[type="text"]').height()/2) + logoHeight/2 + 17 5832 }); 5833 5834 $('body:not(.ascend) #search-outer > #search #close a').css({ 5835 'top' : ((logoHeight + headerPadding*2)/2) - 8 + logoHeight/2 + 17 5836 }); 5837 } 5838 5839 //if no image is being used 5840 //if(usingLogoImage == false) $('header#top #logo').addClass('no-image'); 5841 5842 } 5843 5844 //one last check to make sure the header space is correct (only if the user hasn't scrolled yet) 5845 $(window).load(function(){ 5846 if($(window).scrollTop() == 0 ) headerSpace(); 5847 }); 5848 5849 5850 //is header resize on scroll enabled? 5851 var headerResize = $('#header-outer').attr('data-header-resize');
5852 var headerHideUntilNeeded = $('body').attr('data-hhun'); 5853 5854 //transparent fix 5855 if($(window).scrollTop() != 0 && $('#header-outer.transparent[data-permanent-transparent="false"]').length == 1) $('#header-outer').removeClass('transparent'); 5856 5857 if( headerResize == 1 && headerHideUntilNeeded != '1'){ 5858 5859 headerInit(); 5860 5861 $(window).off('scroll.headerResizeEffect'); 5862 $(window).on('scroll.headerResizeEffect',smallNav); 5863 } else if(headerHideUntilNeeded != '1') { 5864 headerInit(); 5865 $(window).off('scroll.headerResizeEffectOpaque'); 5866- $(window).on('scroll.headerResizeEffectOpaque',opaqueCheck); 5867 5868 } else if(headerHideUntilNeeded == '1') { 5869 5870 headerInit(); 5871 5872 if($('.nectar-box-roll').length > 0) $('#header-outer').addClass('at-top-before-box'); 5873 5874 var previousScroll = 0, // previous scroll position 5875 menuOffset = $('#header-space').height()*2, // height of menu (once scroll passed it, menu is hidden) 5876 detachPoint = ($('body.mobile').length > 0) ? 150 : 600, // point of detach (after scroll passed it, menu is fixed) 5877 hideShowOffset = 6; // scrolling value after which triggers hide/show menu 5878 5879 // on scroll hide/show menu 5880 function hhunCalcs(e) { 5881 5882 //stop scrolling while animated anchors 5883 if($('body.animated-scrolling').length > 0 && $('#header-outer.detached').length > 0) return false; 5884 5885 //stop on mobile if not using sticky option 5886 if($('#header-outer[data-mobile-fixed="false"]').length > 0 && $('body.mobile').length > 0) { $('#header-outer').removeClass('detached'); return false; } 5887 5888 var currentScroll = $(this).scrollTop(), // gets current scroll position 5889 scrollDifference = Math.abs(currentScroll - previousScroll); // calculates how fast user is scrolling 5890 5891 if (!$('#header-outer').hasClass('side-widget-open') && !$('#header-outer .slide-out-widget-area-toggle a').hasClass('animating')) { 5892 5893 // if scrolled past menu 5894 if (currentScroll > menuOffset) { 5895 // if scrolled past detach point add class to fix menu 5896 if (currentScroll > detachPoint) { 5897 if (!$('#header-outer').hasClass('detached')) 5898 $('#header-outer').addClass('detached').removeClass('parallax-contained'); 5899 5900 if($('#header-outer[data-permanent-transparent="1"]').length == 0) $('#header-outer').removeClass('transparent'); 5901 } 5902 5903 // if scrolling faster than hideShowOffset hide/show menu 5904 if (scrollDifference >= hideShowOffset) { 5905 if (currentScroll > previousScroll) { 5906 // scrolling down; hide menu 5907 if (!$('#header-outer').hasClass('invisible')) 5908 $('#header-outer').addClass('invisible').removeClass('at-top'); 5909 $('.page-submenu.stuck').css('transform','translateY(0px)').addClass('header-not-visible'); 5910 5911 } else { 5912 // scrolling up; show menu 5913 if ($('#header-outer').hasClass('invisible')) 5914 $('#header-outer').removeClass('invisible'); 5915 $('.page-submenu.stuck').css('transform','translateY('+$('#header-outer').outerHeight()+'px)').removeClass('header-not-visible'); 5916 } 5917 } 5918 } else { 5919 // only remove âdetachedâ class if user is at the top of document (menu jump fix) 5920 $topDetachNum = ($('#header-outer[data-using-secondary="1"]').length > 0) ? 32 : 0; 5921 if (currentScroll <= $topDetachNum){ 5922 $('#header-outer').removeClass('detached').addClass('at-top'); 5923 5924 if($('#header-outer[data-transparent-header="true"]').length > 0 && $('.nectar-box-roll').length == 0) $('#header-outer').addClass('transparent').css('transform','translateY(0)'); 5925 else if($('.nectar-box-roll').length > 0) $('#header-outer').css('transform','translateY(0)').addClass('at-top-before-box'); 5926 5927 if($('.parallax_slider_outer').length > 0 || $('#page-header-bg[data-parallax="1"]').length > 0) $('#header-outer').addClass('parallax-contained').css('transform','translateY(0)'); 5928 } 5929 } 5930 5931 // if user is at the bottom of document show menu 5932 if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) { 5933 $('#header-outer').removeClass('invisible'); 5934 $('.page-submenu.stuck').css('transform','translateY('+$('#header-outer').outerHeight()+'px)').removeClass('header-not-visible'); 5935 } 5936 5937 } 5938 5939 // replace previous scroll position with new one 5940 previousScroll = currentScroll; 5941 5942 } 5943 5944 hhunCalcs(); 5945 $(window).scroll(hhunCalcs); 5946 5947 5948 }//end if hhun 5949 5950 midnightInit(); //init midnight 5951 5952 var shrinkNum = 6; 5953 var extraHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar 5954 5955 if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num'); 5956 5957 function smallNav(){ 5958 var $offset = $(window).scrollTop(); 5959 var $windowWidth = $(window).width(); 5960 5961 5962 if($offset > 0 && $windowWidth > 1000) { 5963 5964 5965 if($('#header-outer').attr('data-transparent-header') == 'true' && $('#header-outer.side-widget-open').length == 0 && $('#header-outer[data-permanent-transparent="1"]').length == 0) $('#header-outer').removeClass('transparent'); 5966 $('.ns-loading-cover').hide(); 5967 5968 $('#header-outer').addClass('small-nav'); 5969 5970 $('#header-outer #logo img').stop(true,true).animate({ 5971 'height' : logoHeight - shrinkNum 5972 },{queue:false, duration:250, easing: 'easeOutCubic'}); 5973 5974 $('#header-outer').stop(true,true).animate({
5975 'padding-top' : Math.ceil(headerPadding / 1.8) 5976 },{queue:false, duration:250, easing: 'easeOutCubic'}); 5977 5978 if($('body.ascend[data-slide-out-widget-area="true"] #header-outer[data-has-menu="false"][data-permanent-transparent="false"][data-full-width="false"] header#top').length > 0 || $('body:not(.ascend)[data-slide-out-widget-area="true"] #header-outer[data-has-menu="false"][data-permanent-transparent="false"] header#top').length > 0) { 5979 5980 $('#header-outer header#top').stop(true,true).animate({ 5981 'padding-bottom' : Math.ceil(headerPadding / 1.8) 5982 },{queue:false, duration:250, easing: 'easeOutCubic'}); 5983 } 5984 5985 $('header#top nav > ul > li > a').stop(true,true).animate({ 5986 'padding-bottom' : Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding / 1.8) , 5987 'padding-top' : Math.floor(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2)) 5988 },{queue:false, duration:250, easing: 'easeOutCubic'}); 5989 5990 if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) { 5991 $('#header-outer .cart-menu').stop(true,true).animate({ 5992 'padding-top' : Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding/ 1.7), 5993 'padding-bottom' : Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding/ 1.7) +1 5994 },{queue:false, duration:250, easing: 'easeOutCubic'}); 5995 } else { 5996 /*$('#header-outer img.starting-logo').stop(true,true).animate({ 5997 'margin-top' : '-' + (logoHeight + 17 - shrinkNum) + 'px' 5998 },{queue:false, duration:250, easing: 'easeOutCubic'}); */ 5999 6000 $('#header-outer .cart-menu').stop(true,true).animate({ 6001 'padding-bottom' : Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding / 1.7) + (logoHeight-shrinkNum)/2 + 9, 6002 'padding-top' : Math.floor((((logoHeight-shrinkNum)/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding / 1.7) + (logoHeight-shrinkNum)/2 + 9 6003 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6004 } 6005 6006 if($('body.ascend ').length > 0 && $('#header-outer[data-full-width="true"]').length > 0) { 6007 $('header#top nav > ul.buttons').stop(true,true).animate({ 6008 'margin-top' : - Math.ceil(headerPadding/ 1.8), 6009 'height' : Math.floor((headerPadding*2)/ 1.8 + logoHeight-shrinkNum) 6010 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6011 6012 $('header#top nav > ul li#search-btn a, header#top nav > ul li.slide-out-widget-area-toggle a').stop(true,true).animate({ 6013 'padding-top' : Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding/ 1.7), 6014 'padding-bottom' : Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding/ 1.7) +1 6015 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6016 6017 } else { 6018 $('header#top nav > ul li#search-btn, header#top nav > ul li.slide-out-widget-area-toggle').stop(true,true).animate({ 6019 'padding-bottom' : Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2)), 6020 'padding-top' : Math.ceil(((logoHeight-shrinkNum)/2) - ($('header#top nav > ul li#search-btn a').height()/2)) 6021 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6022 } 6023 6024 $('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').stop(true,true).animate({ 6025 'top' : Math.floor($('header#top nav > ul > li > a').height() + (((logoHeight-shrinkNum)/2) - ($('header#top nav > ul > li > a').height()/2))*2 + headerPadding / 1.8), 6026 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6027 6028 6029 $('body:not(.ascend) #search-outer #search-box .ui-autocomplete').stop(true,true).animate({ 6030 'top': Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8) +'px' 6031 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6032 6033 6034 if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) { 6035 $('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({ 6036 'height' : Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8) 6037 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6038 6039 $('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({ 6040 'font-size' : 30, 6041 'line-height' : '30px', 6042 'height' : '44px', 6043 'top' : ((logoHeight-shrinkNum+headerPadding+5)/2) - ($('#search-outer > #search input[type="text"]').height()-15)/2 6044 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6045 6046 $('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({ 6047 'top' : ((logoHeight-shrinkNum + headerPadding+5)/2) - 10 6048 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6049 6050 } else { 6051 $('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({ 6052 'height' : Math.floor((logoHeight-shrinkNum) + (headerPadding*2)/ 1.8) + logoHeight - shrinkNum + 17 6053 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6054 6055 $('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({ 6056 'font-size' : 30, 6057 'line-height' : '30px', 6058 'height' : '44px', 6059 'top' : ((logoHeight-shrinkNum+headerPadding+5)/2) - ($('#search-outer > #search input[type="text"]').height()-15)/2 + (logoHeight- shrinkNum)/2 + 8 6060 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6061 6062 $('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({ 6063 'top' : ((logoHeight-shrinkNum + headerPadding+5)/2) - 10 + (logoHeight- shrinkNum)/2 + 8 6064 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6065 } 6066 6067 6068 6069 6070 //box roll 6071 if($('.nectar-box-roll').length > 0 && $('#header-outer[data-permanent-transparent="1"]').length == 0) $('#ajax-content-wrap').animate({'margin-top': (Math.floor((logoHeight-shrinkNum) +(headerPadding*2)/ 1.8 + extraHeight + secondaryHeader)) },{queue:false, duration:250, easing: 'easeOutCubic'}) 6072 6073 6074 if($('body').hasClass('ascend')){ 6075 $('#search-outer').stop(true,true).animate({ 6076 'top' : Math.floor((logoHeight-shrinkNum) +(headerPadding*2)/ 1.8 + extraHeight + secondaryHeader) 6077 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6078 } 6079 6080 //if no image is being used 6081 if(usingLogoImage == false) $('header#top #logo').stop(true,true).animate({ 6082 'margin-top' : 0 6083 },{queue:false, duration:450, easing: 'easeOutExpo'}); 6084 6085 $(window).off('scroll',smallNav); 6086 $(window).on('scroll',bigNav); 6087 6088 //dark slider coloring border fix 6089 $('#header-outer[data-transparent-header="true"]').css('transition','background-color 0.40s ease, box-shadow 0.40s ease'); 6090 $('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','none'); 6091 setTimeout(function(){ 6092 $('#header-outer[data-transparent-header="true"]').css('transition','background-color 0.40s ease, box-shadow 0.40s ease, border-color 0.40s ease'); 6093 $('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','border-color 0.40s ease'); 6094 },300); 6095 6096 } 6097 6098 } 6099 6100 function bigNav(){ 6101 var $offset = $(window).scrollTop(); 6102 var $windowWidth = $(window).width(); 6103 if($offset == 0 && $windowWidth > 1000 || $('.small-nav').length > 0 && $('#ajax-content-wrap.no-scroll').length > 0) { 6104 6105 $('#header-outer').removeClass('small-nav'); 6106 6107 if($('#header-outer').attr('data-transparent-header') == 'true' && $('.nectar-box-roll').length == 0) $('#header-outer').addClass('transparent'); 6108 $('.ns-loading-cover').show(); 6109 6110 $('#header-outer #logo img').stop(true,true).animate({ 6111 'height' : logoHeight, 6112 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6113 6114 6115 $('#header-outer').stop(true,true).animate({ 6116 'padding-top' : headerPadding 6117 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6118
6119 if($('body.ascend[data-slide-out-widget-area="true"] #header-outer[data-has-menu="false"][data-permanent-transparent="false"][data-full-width="false"] header#top').length > 0 || $('body:not(.ascend)[data-slide-out-widget-area="true"] #header-outer[data-has-menu="false"][data-permanent-transparent="false"] header#top').length > 0) { 6120 $('#header-outer header#top').stop(true,true).animate({ 6121 'padding-bottom' : headerPadding 6122 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6123 } 6124 6125 $('header#top nav > ul > li > a').stop(true,true).animate({ 6126 'padding-bottom' : ((logoHeight/2) - ($('header#top nav > ul > li > a').height()/2)) + headerPadding, 6127 'padding-top' : (logoHeight/2) - ($('header#top nav > ul > li > a').height()/2) 6128 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6129 6130 if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) { 6131 $('#header-outer .cart-menu').stop(true,true).animate({ 6132 'padding-bottom' : Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding), 6133 'padding-top' : Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding) 6134 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6135 } else { 6136 /*$('#header-outer img.starting-logo').stop(true,true).animate({ 6137 'margin-top' : '-' + (logoHeight + 17) + 'px' 6138 },{queue:false, duration:250, easing: 'easeOutCubic'}); */ 6139 6140 $('#header-outer .cart-menu').stop(true,true).animate({ 6141 'padding-bottom' : Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding) + logoHeight/2 + 7, 6142 'padding-top' : Math.ceil(((logoHeight/2) - ($('header#top nav ul #search-btn a').height()/2)) + headerPadding) + logoHeight/2 + 7 6143 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6144 } 6145 6146 if($('body.ascend ').length > 0 && $('#header-outer[data-full-width="true"]').length > 0) { 6147 $('header#top nav > ul.buttons').stop(true,true).animate({ 6148 'margin-top' : - Math.ceil(headerPadding), 6149 'height' : Math.floor(headerPadding*2 + logoHeight) -1 6150 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6151 6152 $('header#top nav > ul li#search-btn a, header#top nav > ul li.slide-out-widget-area-toggle a').stop(true,true).animate({ 6153 'padding-top': Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding), 6154 'padding-bottom': Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2) + headerPadding) 6155 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6156 } else { 6157 $('header#top nav > ul li#search-btn, header#top nav > ul li.slide-out-widget-area-toggle').stop(true,true).animate({ 6158 'padding-bottom' : Math.floor((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2)), 6159 'padding-top' : Math.ceil((logoHeight/2) - ($('header#top nav > ul li#search-btn a').height()/2)) 6160 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6161 } 6162 6163 $('header#top .sf-menu > li > ul, header#top .sf-menu > li.sfHover > ul').stop(true,true).animate({ 6164 'top' : Math.ceil($('header#top nav > ul > li > a').height() + (((logoHeight)/2) - ($('header#top nav > ul > li > a').height()/2))*2 + headerPadding), 6165 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6166 6167 $('body:not(.ascend) #search-outer #search-box .ui-autocomplete').stop(true,true).animate({ 6168 'top': Math.ceil(logoHeight + headerPadding*2) +'px' 6169 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6170 6171 6172 if($('#header-outer[data-format="centered-menu-under-logo"]').length == 0) { 6173 $('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({ 6174 'height' : Math.ceil(logoHeight + headerPadding*2) 6175 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6176 6177 $('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({ 6178 'font-size' : 43, 6179 'line-height' : '43px', 6180 'height' : '59px', 6181 'top' : ((logoHeight + headerPadding*2)/2) - 30 6182 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6183 6184 6185 $('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({ 6186 'top' : ((logoHeight + headerPadding*2)/2) - 8 6187 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6188 6189 } else { 6190 $('body:not(.ascend) #search-outer, #search .container').stop(true,true).animate({
6191 'height' : Math.ceil(logoHeight + headerPadding*2) + logoHeight + 17 6192 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6193 6194 $('body:not(.ascend) #search-outer > #search input[type="text"]').stop(true,true).animate({ 6195 'font-size' : 43, 6196 'line-height' : '43px', 6197 'height' : '59px', 6198 'top' : ((logoHeight + headerPadding*2)/2) - 30 + (logoHeight)/2 + 8 6199 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6200 6201 6202 $('body:not(.ascend) #search-outer > #search #close a').stop(true,true).animate({ 6203 'top' : ((logoHeight + headerPadding*2)/2) - 8 + (logoHeight)/2 + 8 6204 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6205 } 6206 6207 6208 if($('body').hasClass('ascend')){ 6209 $('#search-outer').stop(true,true).animate({ 6210 'top' : (logoHeight) +(headerPadding*2) + extraHeight + secondaryHeader 6211 },{queue:false, duration:250, easing: 'easeOutCubic'}); 6212 } 6213 6214 //if no image is being used 6215 if(usingLogoImage == false) $('header#top #logo').stop(true,true).animate({ 6216 'margin-top' : 4 6217 },{queue:false, duration:450, easing: 'easeOutExpo'}); 6218 6219 6220 //box roll 6221 if($('.nectar-box-roll').length > 0 && $('#header-outer[data-permanent-transparent="1"]').length == 0) $('#ajax-content-wrap').animate({'margin-top': (Math.floor((logoHeight) +(headerPadding*2) + extraHeight + secondaryHeader)) },{queue:false, duration:250, easing: 'easeOutCubic'}) 6222 6223 6224 $(window).off('scroll',bigNav); 6225 $(window).on('scroll',smallNav); 6226 6227 6228 //dark slider coloring border fix 6229 $('#header-outer[data-transparent-header="true"]').css('transition','background-color 0.40s ease, box-shadow 0.40s ease'); 6230 $('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','none'); 6231 setTimeout(function(){ 6232 $('#header-outer[data-transparent-header="true"]').css('transition','background-color 0.40s ease, box-shadow 0.40s ease, border-color 0.40s ease'); 6233 $('#header-outer[data-transparent-header="true"] .cart-menu').css('transition','border-color 0.40s ease'); 6234 },300); 6235 } 6236 6237 } 6238 6239 6240 function headerSpace() { 6241 if($('.mobile').length > 0) { 6242 if(window.innerHeight < window.innerWidth && window.innerWidth > 1000) { 6243 $('#header-space').css('height', $('#header-outer').outerHeight() + $('#header-secondary-outer').height()); 6244 } else { 6245 $('#header-space').css('height', $('#header-outer').outerHeight()); 6246 } 6247 6248 } else { 6249 if($('.nectar-parallax-scene.first-section').length == 0) { 6250 6251 var shrinkNum = 6; 6252 var headerPadding = parseInt($('#header-outer').attr('data-padding')); 6253 if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num'); 6254 var headerPadding2 = headerPadding - headerPadding/1.8; 6255 var $headerHeight = ($('#header-outer[data-header-resize="1"]').length > 0 && $('.small-nav').length > 0 ) ? $('#header-outer').outerHeight() + (parseInt(shrinkNum) + headerPadding2*2) : $('#header-outer').outerHeight(); 6256 6257 if($('#header-outer').attr('data-using-secondary') == '1'){ 6258 $('#header-space').css('height', $headerHeight + $('#header-secondary-outer').height()); 6259 } else { 6260 $('#header-space').css('height', $headerHeight); 6261 } 6262 } 6263 } 6264 6265 } 6266 6267 var lastPosition = -1; 6268 function headerOffsetAdjust(){ 6269 6270 var $scrollTop = $(window).scrollTop(); 6271 6272 if (lastPosition == $scrollTop) { 6273 requestAnimationFrame(headerOffsetAdjust); 6274 return false; 6275 } else lastPosition = $scrollTop; 6276 if($('body.mobile').length > 0) { 6277 var $eleHeight = 0; 6278 var $endOffset = ($('#wpadminbar').css('position') == 'fixed') ? $('#wpadminbar').height() : 0; 6279 if($('#header-secondary-outer').length > 0) $eleHeight += $('#header-secondary-outer').height(); 6280 if($('#wpadminbar').length > 0) $eleHeight += $('#wpadminbar').height(); 6281 6282 if( $eleHeight - $scrollTop > $endOffset) { 6283 $('#header-outer').css('top', $eleHeight - $scrollTop + 'px'); 6284 } 6285 else { $('#header-outer').css('top', $endOffset); } 6286 6287 } else { 6288 var $eleHeight = 0; 6289 if($('#header-secondary-outer').length > 0) $eleHeight += $('#header-secondary-outer').height(); 6290 if($('#wpadminbar').length > 0) $eleHeight += $('#wpadminbar').height(); 6291 $('#header-outer').css('top',$eleHeight+'px'); 6292 } 6293 6294 requestAnimationFrame(headerOffsetAdjust); 6295 6296 } 6297 6298 if($('#header-outer[data-mobile-fixed="1"]').length > 0 && $('#wpadminbar').length > 0 || $('#header-outer[data-mobile-fixed="1"]').length > 0 && $('#header-secondary-outer').length > 0) { 6299 requestAnimationFrame(headerOffsetAdjust); 6300 } 6301 6302 6303 function footerRevealCalcs() { 6304 if($(window).height() - $('#wpadminbar').height() - $('#header-outer').outerHeight() - $('#footer-outer').height() - 1 -$('#page-header-bg').height() -$('.parallax_slider_outer').height() - $('.page-header-no-bg').height() > 0) { 6305 $resizeExtra = ($('#header-outer[data-header-resize="1"]').length > 0) ? 55: 0;
6306 $('.container-wrap').css({'margin-bottom': $('#footer-outer').height()-1, 'min-height': $(window).height() - $('#wpadminbar').height() - $('#header-outer').outerHeight() - $('#footer-outer').height() -1 - $('.page-header-no-bg').height() -$('#page-header-bg').height() -$('.parallax_slider_outer').height() + $resizeExtra }); 6307 } else { 6308 $('.container-wrap').css({'margin-bottom': $('#footer-outer').height()-1 }); 6309 } 6310 6311 if( $(window).width() < 1000) $('#footer-outer').attr('data-midnight','light'); 6312 else $('#footer-outer').removeAttr('data-midnight'); 6313 } 6314 if($('body[data-footer-reveal="1"]').length > 0) { 6315 footerRevealCalcs(); 6316 //set shadow to match BG color if applicable 6317 if($('body[data-footer-reveal-shadow="large_2"]').length > 0) $('.container-wrap').css({ boxShadow: '0 70px 110px -30px '+$('#footer-outer').css('backgroundColor') }); 6318 } 6319 6320 function opaqueCheck(){ 6321 var $offset = $(window).scrollTop(); 6322 var $windowWidth = $(window).width(); 6323 6324 if($offset > 0 && $windowWidth > 1000) { 6325 6326 if($('#header-outer').attr('data-transparent-header') == 'true' && $('#header-outer[data-permanent-transparent="1"]').length == 0) $('#header-outer').removeClass('transparent').addClass('scrolled-down'); 6327 $('.ns-loading-cover').hide(); 6328 6329 $(window).off('scroll',opaqueCheck); 6330 $(window).on('scroll',transparentCheck); 6331 } 6332 } 6333 6334 6335 function transparentCheck(){ 6336 var $offset = $(window).scrollTop(); 6337 var $windowWidth = $(window).width(); 6338 6339 if($offset == 0 && $windowWidth > 1000) { 6340 6341 if($('#header-outer').attr('data-transparent-header') == 'true') $('#header-outer').addClass('transparent').removeClass('scrolled-down'); 6342 $('.ns-loading-cover').show(); 6343 6344 $(window).off('scroll',transparentCheck); 6345 $(window).on('scroll',opaqueCheck); 6346 } 6347 } 6348 6349 var adminBarHeight = ($('#wpadminbar').length > 0) ? $('#wpadminbar').height() : 0; //admin bar 6350 6351 //header inherit row color effect 6352 function headerRowColorInheritInit(){ 6353 if($('body[data-header-inherit-rc="true"]').length > 0 && $('.mobile').length == 0){ 6354 6355 var headerOffset = ($('#header-outer[data-permanent-transparent="1"]').length == 0) ? (logoHeight - shrinkNum) + Math.ceil((headerPadding*2) / 1.8) + adminBarHeight : logoHeight/2 + headerPadding + adminBarHeight; 6356 6357 $('.main-content > .row > .wpb_row').each(function(){ 6358 6359 6360 var $that = $(this); 6361 var waypoint = new Waypoint({ 6362 element: $that, 6363 handler: function(direction) { 6364 6365 6366 if(direction == 'down') { 6367 6368 if($that.find('.row-bg.using-bg-color').length > 0) { 6369 6370 var $textColor = ($that.find('> .col.span_12.light').length > 0) ? 'light-text' : 'dark-text'; 6371 $('#header-outer').css('background-color',$that.find('.row-bg').css('background-color')).removeClass('light-text').removeClass('dark-text').addClass($textColor); 6372 $('#header-outer').attr('data-current-row-bg-color',$that.find('.row-bg').css('background-color')); 6373 } else { 6374 $('#header-outer').css('background-color',$('#header-outer').attr('data-user-set-bg')).removeClass('light-text').removeClass('dark-text'); 6375 $('#header-outer').attr('data-current-row-bg-color',$('#header-outer').attr('data-user-set-bg')); 6376 } 6377 6378 } else { 6379 6380 if($that.prev('div.wpb_row').find('.row-bg.using-bg-color').length > 0) { 6381 var $textColor = ($that.prev('div.wpb_row').find('> .col.span_12.light').length > 0) ? 'light-text' : 'dark-text'; 6382 $('#header-outer').css('background-color',$that.prev('div.wpb_row').find('.row-bg').css('background-color')).removeClass('light-text').removeClass('dark-text').addClass($textColor); 6383 $('#header-outer').attr('data-current-row-bg-color', $that.prev('div.wpb_row').find('.row-bg').css('background-color')); 6384 } else { 6385 $('#header-outer').css('background-color',$('#header-outer').attr('data-user-set-bg')).removeClass('light-text').removeClass('dark-text'); 6386 $('#header-outer').attr('data-current-row-bg-color',$('#header-outer').attr('data-user-set-bg')); 6387 } 6388 6389 } 6390 6391 6392 }, 6393 offset: headerOffset 6394 6395 }); 6396 6397 6398 }); 6399 } 6400 } 6401 6402 if($('.nectar-box-roll').length == 0) headerRowColorInheritInit(); 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412/****************sticky page submenu******************/ 6413 if($('.page-submenu[data-sticky="true"]').length > 0) { 6414 6415 (function() { 6416 'use strict' 6417 6418 var $ = window.jQuery 6419 var Waypoint = window.Waypoint 6420 var $offsetHeight = 0; 6421 var shrinkNum = 6; 6422 var headerPadding = parseInt($('#header-outer').attr('data-padding'));
6423 if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num'); 6424 var headerPadding2 = headerPadding - headerPadding/1.8; 6425 var $headerHeight = ($('#header-outer[data-header-resize="1"]').length > 0 && $('body.mobile').length == 0) ? $('#header-outer').outerHeight() - (parseInt(shrinkNum) + headerPadding2*2) : $('#header-outer').outerHeight(); 6426 6427 if($('#header-secondary-outer').length > 0 && $('body.mobile').length == 0) $headerHeight += $('#header-secondary-outer').height(); 6428 6429 6430 6431 $(window).on('smartresize',function(){ 6432 6433 $headerHeight = ($('#header-outer[data-header-resize="1"]').length > 0 && $('.small-nav').length == 0 && $('body.mobile').length == 0) ? $('#header-outer').outerHeight() - (parseInt(shrinkNum) + headerPadding2*2) : $('#header-outer').outerHeight(); 6434 if($('#header-secondary-outer').length > 0 && $('body.mobile').length == 0) $headerHeight += $('#header-secondary-outer').height(); 6435 6436 $offsetHeight = 0; 6437 6438 if($('#wpadminbar').length > 0 && $('#wpadminbar').css('position') == 'fixed') $offsetHeight += $('#wpadminbar').height(); 6439 if($('body[data-hhun="0"] #header-outer').length > 0 && !($('body.mobile').length > 0 && $('#header-outer[data-mobile-fixed="false"]').length > 0) ) $offsetHeight += $headerHeight; 6440 6441 // else if($('body[data-hhun="1"] #header-outer.detached:not(.invisible)').length > 0) $offsetHeight += $headerHeight; 6442 6443 //recalc for resizing (same as stuck/unstuck logic below) 6444 if($('.page-submenu.stuck').length > 0) { 6445 6446 $('.page-submenu.stuck').addClass('no-trans').css('top',$offsetHeight).css('transform','translateY(0)').addClass('stuck'); 6447 var $that = this; 6448 setTimeout(function(){ $('.page-submenu.stuck').removeClass('no-trans'); },50); 6449 $('.page-submenu.stuck').parents('.wpb_row').css('z-index',10000); 6450 6451 //boxed 6452 if($('#boxed').length > 0) { 6453 var $negMargin = ($(window).width() > 1000) ? $('.container-wrap').width()*0.04 :39; 6454 $('.page-submenu.stuck').css({'margin-left':'-'+$negMargin+'px', 'width' : $('.container-wrap').width()}); 6455 } 6456 6457 } 6458 else { 6459 $('.page-submenu.stuck').css('top','0').removeClass('stuck'); 6460 $('.page-submenu.stuck').parents('.wpb_row').css('z-index','auto'); 6461 6462 if($('#boxed').length > 0) $('.page-submenu.stuck').css({'margin-left':'0px', 'width' : '100%'}); 6463 } 6464 6465 }); 6466 6467 /* http://imakewebthings.com/waypoints/shortcuts/sticky-elements */ 6468 function Sticky(options) { 6469 this.options = $.extend({}, Waypoint.defaults, Sticky.defaults, options) 6470 this.element = this.options.element 6471 this.$element = $(this.element) 6472 this.createWrapper() 6473 this.createWaypoint() 6474 } 6475 6476 /* Private */ 6477 Sticky.prototype.createWaypoint = function() { 6478 var originalHandler = this.options.handler 6479 6480 $offsetHeight = 0; 6481 if($('#wpadminbar').length > 0 && $('#wpadminbar').css('position') == 'fixed') $offsetHeight += $('#wpadminbar').height(); 6482 if($('body[data-hhun="0"] #header-outer').length > 0 && !($('body.mobile').length > 0 && $('#header-outer[data-mobile-fixed="false"]').length > 0)) $offsetHeight += $headerHeight; 6483 6484 6485 this.waypoint = new Waypoint($.extend({}, this.options, { 6486 element: this.wrapper, 6487 handler: $.proxy(function(direction) { 6488 var shouldBeStuck = this.options.direction.indexOf(direction) > -1 6489 var wrapperHeight = shouldBeStuck ? this.$element.outerHeight(true) : '' 6490 6491 this.$wrapper.height(wrapperHeight) 6492 if(shouldBeStuck) { 6493 this.$element.addClass('no-trans').css('top',$offsetHeight).css('transform','translateY(0)').addClass('stuck'); 6494 var $that = this; 6495 setTimeout(function(){ $that.$element.removeClass('no-trans'); },50); 6496 this.$element.parents('.wpb_row').css('z-index',10000); 6497 6498 //boxed 6499 if($('#boxed').length > 0) { 6500 var $negMargin = ($(window).width() > 1000) ? $('.container-wrap').width()*0.04 :39; 6501 this.$element.css({'margin-left':'-'+$negMargin+'px', 'width' : $('.container-wrap').width()}); 6502 } 6503 6504 } 6505 else { 6506 this.$element.css('top','0').removeClass('stuck'); 6507 //this.$element.parents('.wpb_row').css('z-index','10000'); 6508 6509 if($('#boxed').length > 0) this.$element.css({'margin-left':'0px', 'width' : '100%'});
6510 } 6511 6512 if (originalHandler) { 6513 originalHandler.call(this, direction) 6514 } 6515 }, this), 6516 offset: $offsetHeight 6517 })) 6518 6519 var $that = this; 6520 6521 // if($('body[data-hhun="1"]').length > 0 ) { 6522 setInterval(function(){ 6523 6524 if($('body[data-hhun="1"] #header-outer.detached:not(.invisible)').length > 0) 6525 $that.waypoint.options.offset = $offsetHeight + $headerHeight; 6526 else 6527 $that.waypoint.options.offset = $offsetHeight; 6528 Waypoint.refreshAll(); 6529 6530 },100); 6531 //} 6532 6533 } 6534 6535 /* Private */ 6536 Sticky.prototype.createWrapper = function() { 6537 if (this.options.wrapper) { 6538 this.$element.wrap(this.options.wrapper) 6539 } 6540 this.$wrapper = this.$element.parent() 6541 this.wrapper = this.$wrapper[0] 6542 } 6543 6544 /* Public */ 6545 Sticky.prototype.destroy = function() { 6546 if (this.$element.parent()[0] === this.wrapper) { 6547 this.waypoint.destroy() 6548 this.$element.removeClass(this.options.stuckClass) 6549 if (this.options.wrapper) { 6550 this.$element.unwrap() 6551 } 6552 } 6553 } 6554 6555 Sticky.defaults = { 6556 wrapper: '<div class="sticky-wrapper" />', 6557 stuckClass: 'stuck', 6558 direction: 'down right' 6559 } 6560
6561 Waypoint.Sticky = Sticky 6562 }()) 6563 ; 6564 6565 //remove outside of column setups 6566 if($('.page-submenu').parents('.span_12').find('> .wpb_column').length > 1){ 6567 var pageMenu = $('.page-submenu').clone(); 6568 var pageMenuParentRow = $('.page-submenu').parents('.wpb_row'); 6569 $('.page-submenu').remove(); 6570 pageMenuParentRow.before(pageMenu); 6571 } 6572 6573 var sticky = new Waypoint.Sticky({ 6574 element: $('.page-submenu[data-sticky="true"]')[0] 6575 }); 6576 6577 6578 } 6579 6580 $('.page-submenu').parents('.wpb_row').css('z-index',10000); 6581 $('.page-submenu .mobile-menu-link').on('click',function(){ 6582 $(this).parents('.page-submenu').find('ul').stop(true).slideToggle(350); 6583 return false; 6584 }); 6585 6586 $('.page-submenu ul li a').on('click',function(){ 6587 if($('body.mobile').length > 0) $(this).parents('.page-submenu').find('ul').stop(true).slideToggle(350); 6588 }); 6589 6590 6591 6592 6593 6594 //responsive nav 6595 $('body').on('click','#toggle-nav',function(){ 6596 6597 $('#mobile-menu').stop(true,true).slideToggle(500); 6598 return false; 6599 }); 6600 6601 6602 //add wpml to mobile menu 6603 if($('header#top nav > ul > li.menu-item-language').length > 0 && $('#header-secondary-outer ul > li.menu-item-language').length == 0){ 6604 var $langSelector = $('header#top nav > ul > li.menu-item-language').clone(); 6605 $langSelector.insertBefore('#mobile-menu ul #mobile-search'); 6606 } 6607 6608 ////append dropdown indicators / give classes 6609 $('#mobile-menu .container ul li').each(function(){ 6610 if($(this).find('> ul').length > 0) { 6611 $(this).addClass('has-ul'); 6612 $(this).find('> a').append('<span class="sf-sub-indicator"><i class="icon-angle-down"></i></span>'); 6613 } 6614 }); 6615 6616 ////events 6617 $('#mobile-menu .container ul li:has(">ul") > a .sf-sub-indicator').click(function(){ 6618 $(this).parent().parent().toggleClass('open'); 6619 $(this).parent().parent().find('> ul').stop(true,true).slideToggle(); 6620 return false; 6621 }); 6622 6623 6624 6625/*-------------------------------------------------------------------------*/ 6626/* 5. Page Specific 6627/*-------------------------------------------------------------------------*/ 6628 6629 //recent work 6630 function piVertCenter() { 6631 $('.portfolio-items > .col').each(function(){ 6632 6633 //style 4 6634 $(this).find('.style-4 .work-info .bottom-meta:not(.shown)').stop().animate({ 6635 'bottom' : '-'+$(this).find('.work-info .bottom-meta').outerHeight()-2+'px' 6636 },420,'easeOutCubic'); 6637 6638 6639 }); 6640 } 6641 6642 $(window).load(function(){ 6643 portfolioCommentOrder(); 6644 fullWidthContentColumns(); 6645 resizeVideoToCover(); 6646 }); 6647 6648 6649 //ie8 width fix 6650 function ie8Width(){ 6651 if( $(window).width() >= 1300 ) { 6652 $('.container').css('max-width','1100px'); 6653 } else { 6654 $('.container').css('max-width','880px'); 6655 } 6656 } 6657 6658 if( $(window).width() >= 1300 && $('html').hasClass('no-video')) { $('.container').css('max-width','1100px'); $(window).resize(ie8Width); }; 6659 6660 6661 6662 function smartResizeInit() { 6663 6664 //carousel height calcs 6665 carouselHeightCalcs(); 6666 clientsCarouselHeightRecalc(); 6667 6668 //portfolio comment order 6669 portfolioCommentOrder(); 6670 6671 //testimonial slider height 6672 testimonialHeightResize(); //animated 6673 testimonialSliderHeight(); //non-animated 6674 6675 //full width content columns sizing 6676 fullWidthContentColumns(); 6677 6678 //parallax BG Calculations 6679 if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)){ 6680 parallaxRowsBGCals(); 6681 } 6682 6683 slideOutWidgetOverflowState(); 6684 recentPostHeight(); 6685 6686 morphingOutlines(); 6687 6688 //full width menu megamenu adjust 6689 if($('.slide-out-widget-area-toggle a.open').length > 0 && $('#header-outer[data-full-width="true"]').length > 0) fullWidthHeaderSlidingWidgetMenuCalc(); 6690 6691 } 6692 6693 $(window).off('smartresize.srInit'); 6694 $(window).on('smartresize.srInit', smartResizeInit); 6695 6696 6697 6698 function resizeInit() { 6699 portfolioDeviceCheck(); 6700 6701 //fullwidth page section calcs 6702 fullWidthSections(); 6703 fullwidthImgOnlySizing(); 6704 fullWidthContentColumns(); 6705 fullWidthRowPaddingAdjustCalc(); 6706 6707 //iframe video emebeds 6708 responsiveVideoIframes(); 6709 videoshortcodeSize(); 6710 6711 if($('.nectar-social.full-width').length > 0) { 6712 nectarLoveFWCenter(); 6713 } 6714 6715 if($('body').hasClass('ascend')){ 6716 searchFieldCenter(); 6717 } 6718 6719 if($('body').hasClass('single-post')) centerPostNextButtonImg(); 6720 6721 //fixed sidebar for portfolio 6722 sidebarPxConversion(); 6723 6724 headerSpace(); 6725 6726 //vc mobile columns 6727 if($('[class*="vc_col-xs-"], [class*="vc_col-md-"], [class*="vc_col-lg-"]').length > 0) vcMobileColumns(); 6728 6729 if($('body[data-footer-reveal="1"]').length > 0) footerRevealCalcs(); 6730 6731 if($('#page-header-bg').length > 0) pageHeader(); 6732 6733 if($('.nectar-video-bg').length > 0) { 6734 resizeVideoToCover(); 6735 } 6736 } 6737 6738 $(window).off('resize.srInit'); 6739 $(window).on('resize.srInit', resizeInit); 6740 6741 $(window).on("orientationchange",function(){ 6742 setTimeout(clientsCarouselHeightRecalc,200); 6743 }); 6744 6745 //blog next post button 6746 function postNextButtonEffect(){ 6747 6748 $('.blog_next_prev_buttons').imagesLoaded(function(){ 6749 6750 centerPostNextButtonImg(); 6751 6752 $('.blog_next_prev_buttons img').css('opacity','1'); 6753 6754 if(!$('body').hasClass('mobile') && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) { 6755 $('.blog_next_prev_buttons img').panr({ 6756 scaleDuration: .28, 6757 sensitivity: 22, 6758 scaleTo: 1.06 6759 }); 6760 } 6761 6762 }); 6763 } 6764 6765 function centerPostNextButtonImg(){ 6766 6767 if($('.blog_next_prev_buttons').length == 0) return false; 6768 6769 if( $('.blog_next_prev_buttons img').height() >= $('.blog_next_prev_buttons').height() + 50 ) { 6770 var $height = 'auto'; 6771 var $width = $('.blog_next_prev_buttons').width(); 6772 } else { 6773 6774 if( $('.blog_next_prev_buttons').width() < $('.blog_next_prev_buttons img').width()) { 6775 var $height = $('.blog_next_prev_buttons').height() + 49; 6776 var $width = 'auto'; 6777 } else { 6778 var $height = 'auto'; 6779 var $width = '100%'; 6780 } 6781 6782 } 6783 6784 $('.blog_next_prev_buttons img').css({ 'height' : $height, 'width': $width }); 6785 6786 $('.blog_next_prev_buttons img').css({ 6787 'top' : ($('.blog_next_prev_buttons').height()/2) - ($('.blog_next_prev_buttons img').height()/2) + 'px', 6788 'left' : ($('.blog_next_prev_buttons').width()/2) - ($('.blog_next_prev_buttons img').width()/2) + 'px' 6789 }); 6790 6791 $('.blog_next_prev_buttons .inner').each(function(){ 6792 $(this).css({'top': $(this).parent().height()/2 - ($(this).height()/2), 'opacity':'1' }); 6793 }) 6794 } 6795 6796 postNextButtonEffect(); 6797 6798 6799 function recentPostHeight() { 6800 $('.blog-recent[data-style="title_only"]').each(function(){ 6801 if($(this).find('> .col').length > 1) return false; 6802 if($(this).parent().parent().hasClass('vc_col-sm-3') || 6803 $(this).parent().parent().hasClass('vc_col-sm-4') || 6804 $(this).parent().parent().hasClass('vc_col-sm-6') || 6805 $(this).parent().parent().hasClass('vc_col-sm-8') || 6806 $(this).parent().parent().hasClass('vc_col-sm-9')) { 6807 6808 if($('body.mobile').length == 0 && $(this).next('div').length == 0) { 6809 var tallestColumn = 0; 6810 6811 $(this).find('> .col').css('padding', '50px 20px'); 6812 6813 $(this).parents('.wpb_row').find('> .span_12 > .wpb_column').each(function(){ 6814 (Math.floor($(this).height()) > tallestColumn) ? tallestColumn = Math.floor($(this).height()) : tallestColumn = tallestColumn; 6815 }); 6816 6817 if(Math.floor($(this).find('> .col').outerHeight(true)) < Math.floor($(this).parents('.wpb_row').height()) - 1) { 6818 $(this).find('> .col').css('padding-top',(tallestColumn-$(this).find('> .col').height())/2 + 'px'); 6819 $(this).find('> .col').css('padding-bottom',(tallestColumn-$(this).find('> .col').height())/2 + 'px'); 6820 } 6821 6822 } 6823 else { 6824 $(this).find('> .col').css('padding', '50px 20px'); 6825 } 6826 } 6827 }); 6828 } 6829 recentPostHeight(); 6830 6831 6832 //recent post slider 6833 function recentPostsFlickityInit() { 6834 6835 if($('.nectar-recent-posts-slider-inner').length == 0) return false; 6836 6837 var $rpF = $('.nectar-recent-posts-slider-inner').flickity({ 6838 contain: true, 6839 draggable: true, 6840 lazyLoad: false, 6841 imagesLoaded: true, 6842 percentPosition: true,
6843 prevNextButtons: false, 6844 pageDots: true, 6845 resize: true, 6846 setGallerySize: true, 6847 wrapAround: true, 6848 accessibility: false 6849 }); 6850 6851 setTimeout(function(){ 6852 $('.nectar-recent-posts-slider-inner').addClass('loaded'); 6853 },1150); 6854 var flkty = $rpF.data('flickity'); 6855 6856 //$rpF.on( 'cellSelect', function() { 6857 // $(flkty.element).parents('.nectar-recent-posts-slider').find('h2:not(.post-ref-'+flkty.selectedIndex+')').hide().css('opacity','0'); 6858 // $(flkty.element).parents('.nectar-recent-posts-slider').find('h2.post-ref-'+flkty.selectedIndex).show().transition({ 'opacity':1},600); 6859 //}); 6860 6861 $rpF.on( 'dragStart', function() { 6862 $('.flickity-viewport').addClass('is-moving'); 6863 }); 6864 $rpF.on( 'dragEnd', function() { 6865 $('.flickity-viewport').removeClass('is-moving'); 6866 }); 6867 6868 recentPostSliderHeight(); 6869 $(window).resize(recentPostSliderHeight); 6870 6871 if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)) 6872 $(window).resize(recentPostSliderParallaxMargins); 6873 6874 function recentPostSliderHeight(){ 6875 6876 $('.nectar-recent-posts-slider').each(function(){ 6877 6878 var $heightCalc; 6879 var $minHeight = 250; 6880 var $windowWidth = $(window).width(); 6881 var $definedHeight = parseInt($(this).attr('data-height')); 6882 6883 var dif = ($('body[data-ext-responsive="true"]').length > 0) ? $(window).width() / 1400 : $(window).width() / 1100; 6884 6885 if( window.innerWidth > 1000 && $('#boxed').length == 0) { 6886 6887 if($(this).parents('.full-width-content').length == 0) { 6888 if($('body[data-ext-responsive="true"]').length > 0 && window.innerWidth >= 1400){ 6889 $(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight)); 6890 } else if($('body[data-ext-responsive="true"]').length == 0 && window.innerWidth >= 1100) { 6891 $(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight)); 6892 } else { 6893 $(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight*dif)); 6894 } 6895 6896 } else { 6897 $(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight*dif)); 6898 } 6899 6900 } else { 6901 6902 //column sliders 6903 var $parentCol = ($(this).parents('.wpb_column').length > 0) ? $(this).parents('.wpb_column') : $(this).parents('.col') ; 6904 if($parentCol.length == 0) $parentCol = $('.main-content'); 6905 6906 if(!$parentCol.hasClass('vc_span12') && !$parentCol.hasClass('main-content') && !$parentCol.hasClass('span_12') && !$parentCol.hasClass('vc_col-sm-12') ) { 6907 6908 var $parentColWidth = sliderColumnDesktopWidth($parentCol); 6909 var $aspectRatio = $definedHeight/$parentColWidth; 6910 6911 6912 //min height 6913 if( $aspectRatio*$parentCol.width() <= $minHeight ){ 6914 $(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',$minHeight); 6915 } else { 6916 $(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',$aspectRatio*$parentCol.width()); 6917 } 6918 6919 } 6920 6921 6922 6923 //regular 6924 else { 6925 6926 //min height 6927 if( $definedHeight*dif <= $minHeight ){ 6928 $(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',$minHeight); 6929 } else { 6930 $(this).find('.nectar-recent-post-slide, .flickity-viewport').css('height',Math.ceil($definedHeight*dif)); 6931 } 6932 6933 } 6934 6935 } 6936 6937 6938 6939 }); 6940 6941 } 6942 6943 ////helper function 6944 function sliderColumnDesktopWidth(parentCol) { 6945 6946 var $parentColWidth = 1100; 6947 var $columnNumberParsed = $(parentCol).attr('class').match(/\d+/); 6948 6949 if($columnNumberParsed == '2') { $parentColWidth = 170 } 6950 else if($columnNumberParsed == '3') { $parentColWidth = 260 } 6951 else if($columnNumberParsed == '4') { $parentColWidth = 340 } 6952 else if($columnNumberParsed == '6') { $parentColWidth = 530 } 6953 else if($columnNumberParsed == '8') { $parentColWidth = 700 } 6954 else if($columnNumberParsed == '9') { $parentColWidth = 805 } 6955 else if($columnNumberParsed == '10') { $parentColWidth = 916.3 } 6956 else if($columnNumberParsed == '12') { $parentColWidth = 1100 } 6957 6958 return $parentColWidth; 6959 } 6960 6961 6962 } 6963 6964 recentPostsFlickityInit(); 6965 6966 if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)) 6967 window.requestAnimationFrame(recentPostSliderParallax); 6968 6969 function recentPostSliderParallax(){ 6970 6971 $('.nectar-recent-posts-slider').each(function(){ 6972 var $offset = parseInt($(this).find('.flickity-slider').position().left); 6973 var $slideLength = $(this).find('.nectar-recent-post-slide').length; 6974 var $lastChildIndex = $(this).find('.nectar-recent-post-slide:last-child').index(); 6975 var $slideWidth = $(this).find('.nectar-recent-post-slide').width(); 6976 //wrapped fix 6977 6978 ////first going to first 6979 if($offset >= -3) { 6980 $(this).find('.nectar-recent-post-slide:last-child .nectar-recent-post-bg').css('margin-left',parseInt(Math.ceil($slideWidth/3.5))+'px'); 6981 } else { 6982 $(this).find('.nectar-recent-post-slide:last-child .nectar-recent-post-bg').css('margin-left','-'+parseInt(Math.ceil($slideWidth/3.5*$lastChildIndex))+'px'); 6983 } 6984 ////last going to first 6985 if(Math.abs($offset) >= ($slideLength-1) * $slideWidth) { 6986 $(this).find('.nectar-recent-post-slide:first-child .nectar-recent-post-bg').css('margin-left','-'+parseInt(Math.ceil(($slideWidth/3.5)*$slideLength))+'px'); 6987 } else { 6988 $(this).find('.nectar-recent-post-slide:first-child .nectar-recent-post-bg').css('margin-left','0px'); 6989 } 6990 6991 $(this).find('.nectar-recent-post-bg').css('transform','translateX('+Math.ceil($(this).find('.flickity-slider').position().left/-3.5)+'px)'); 6992 6993 6994 }); 6995 requestAnimationFrame(recentPostSliderParallax); 6996 } 6997 6998 function recentPostSliderParallaxMargins(){ 6999 7000 $('.nectar-recent-posts-slider').each(function(){ 7001 var $slideWidth = $(this).find('.nectar-recent-post-slide').width(); 7002 $(this).find('.nectar-recent-post-slide').each(function(i){ 7003 $(this).find('.nectar-recent-post-bg').css('margin-left','-'+ parseInt(Math.ceil($slideWidth/3.5)*i)+'px'); 7004 }); 7005 7006 }); 7007 } 7008 7009 if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|BlackBerry|Opera Mini)/)) 7010 recentPostSliderParallaxMargins(); 7011 7012 7013 //portfolio item hover effect 7014 7015 ////desktop event 7016 function portfolioHoverEffects() { 7017 7018 if(!$('body').hasClass('mobile') && !navigator.userAgent.match(/(iPad|IEMobile)/)) { 7019 7020 //style 1 & 2 7021 $('.portfolio-items .col .work-item:not(.style-3-alt):not(.style-3):not([data-custom-content="on"])').hover(function(){ 7022 $(this).find('.work-info .vert-center').css({'margin-top' : 0}); 7023 $(this).find('.work-info, .work-info .vert-center *, .work-info > i').css({'opacity' : 1}); 7024 $(this).find('.work-info-bg').css({ 'opacity' : 0.9 }); 7025 },function(){ 7026 $(this).find('.work-info .vert-center').css({ 'margin-top' : -20 }); 7027 $(this).find('.work-info, .work-info .vert-center *, .work-info > i').css({ 'opacity' : 0 }); 7028 $(this).find('.work-info-bg').css({ 'opacity' : 0 }); 7029 }); 7030 7031 7032 //style 3 7033 $('.portfolio-items .col .work-item.style-3').hover(function(){ 7034 7035 $(this).find('.work-info-bg').css({ 'opacity' : 0 }); 7036 7037 },function(){ 7038 7039 $(this).find('.work-info-bg').css({ 'opacity' : 0.45 }); 7040 7041 }); 7042 7043 7044 //style 4 7045 $('.portfolio-items .col .work-item.style-4').hover(function(){ 7046 7047 $(this).find('img').stop().animate({ 7048 'top' : '-'+$(this).find('.work-info .bottom-meta').outerHeight()/2+'px' 7049 },250,'easeOutCubic'); 7050 7051 $(this).find('.work-info .bottom-meta').addClass('shown').stop().animate({ 7052 'bottom' : '0px' 7053 },320,'easeOutCubic'); 7054 7055 },function(){ 7056 7057 $(this).find('img').stop().animate({ 7058 'top' : '0px' 7059 },250,'easeOutCubic'); 7060 7061 $(this).find('.work-info .bottom-meta').removeClass('shown').stop().animate({ 7062 'bottom' : '-'+$(this).find('.work-info .bottom-meta').outerHeight()-2+'px' 7063 },320,'easeOutCubic'); 7064 7065 }); 7066 7067 } 7068 ////mobile event 7069 else { 7070 portfolioDeviceCheck(); 7071 } 7072 7073 } 7074 7075 portfolioHoverEffects(); 7076 7077 function style6Img(){ 7078 7079 //change sizer pos 7080 $('.style-5').each(function(){ 7081 $(this).find('.sizer').insertBefore($(this).find('.parallaxImg')); 7082 }); 7083 7084 //set parent zindex 7085 $('.style-5').parents('.wpb_row').css('z-index','100'); 7086 7087 var d = document, 7088 de = d.documentElement, 7089 bd = d.getElementsByTagName('body')[0], 7090 htm = d.getElementsByTagName('html')[0], 7091 win = window, 7092 imgs = d.querySelectorAll('.parallaxImg'), 7093 totalImgs = imgs.length, 7094 supportsTouch = 'ontouchstart' in win || navigator.msMaxTouchPoints; 7095 7096 if(totalImgs <= 0){ 7097 return; 7098 } 7099 7100 // build HTML 7101 for(var l=0;l<totalImgs;l++){ 7102 7103 var thisImg = imgs[l], 7104 layerElems = thisImg.querySelectorAll('.parallaxImg-layer'), 7105 totalLayerElems = layerElems.length; 7106 7107 if(totalLayerElems <= 0){ 7108 continue; 7109 } 7110 7111 while(thisImg.firstChild) { 7112 thisImg.removeChild(thisImg.firstChild); 7113 } 7114 7115 var lastMove = 0; 7116 7117 //throttle performance for all browser other than chrome 7118 var eventThrottle = $('html').hasClass('cssreflections') ? 1 : 80; 7119 if(eventThrottle == 80) $('body').addClass('cssreflections'); 7120 7121 var containerHTML = d.createElement('div'), 7122 shineHTML = d.createElement('div'), 7123 shadowHTML = d.createElement('div'), 7124 layersHTML = d.createElement('div'), 7125 layers = []; 7126 7127 thisImg.id = 'parallaxImg__'+l; 7128 containerHTML.className = 'parallaxImg-container'; 7129 //shineHTML.className = 'parallaxImg-shine'; 7130 shadowHTML.className = 'parallaxImg-shadow'; 7131 layersHTML.className = 'parallaxImg-layers'; 7132 7133 for(var i=0;i<totalLayerElems;i++){ 7134 var layer = d.createElement('div'), 7135 layerInner = d.createElement('div'), 7136 imgSrc = layerElems[i].getAttribute('data-img'); 7137 7138 $(layer).html($(layerElems[i]).html()); 7139 layer.className = 'parallaxImg-rendered-layer'; 7140 layer.setAttribute('data-layer',i); 7141 7142 if(i==0) { 7143 layerInner.className = 'bg-img'; 7144 layerInner.style.backgroundImage = 'url('+imgSrc+')'; 7145 layer.appendChild(layerInner); 7146 } 7147 layersHTML.appendChild(layer); 7148 7149 layers.push(layer); 7150 } 7151 7152 containerHTML.appendChild(layersHTML); 7153 //containerHTML.appendChild(shineHTML); 7154 thisImg.appendChild(containerHTML); 7155 $(thisImg).wrap('<div class="parallaxImg-wrap" />'); 7156 if(!(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1)) { $(thisImg).parent().append(shadowHTML); } 7157 7158 var w = thisImg.clientWidth || thisImg.offsetWidth || thisImg.scrollWidth; 7159 //thisImg.style.transform = 'perspective('+ w*3 +'px)'; 7160 7161 if(supportsTouch){ 7162 /*win.preventScroll = false; 7163 7164 (function(_thisImg,_layers,_totalLayers,_shine) { 7165 $(thisImg).parents('.style-5').on('touchmove', function(e){
7166 if (win.preventScroll){ 7167 e.preventDefault(); 7168 } 7169 window.requestAnimationFrame(function(){ 7170 processMovement(e,true,_thisImg,_layers,_totalLayers,_shine); 7171 }); 7172 }); 7173 $(thisImg).parents('.style-5').on('touchstart', function(e){ 7174 win.preventScroll = true; 7175 processEnter(e,_thisImg,_layers,_totalLayers,_shine); 7176 }); 7177 $(thisImg).parents('.style-5').on('touchend', function(e){ 7178 win.preventScroll = false; 7179 processExit(e,_thisImg,_layers,_totalLayers,_shine); 7180 }); 7181 })(thisImg,layers,totalLayerElems,shineHTML); */ 7182 } else { 7183 (function(_thisImg,_layers,_totalLayers,_shine) { 7184 $(thisImg).parents('.style-5').on('mousemove', function(e){ 7185 7186 var now = Date.now(); 7187 if (now > lastMove + eventThrottle) { 7188 lastMove = now; 7189 window.requestAnimationFrame(function(){ 7190 processMovement(e,false,_thisImg,_layers,_totalLayers,_shine); 7191 }); 7192 } 7193 7194 //window.requestAnimationFrame(function(){ 7195 // processShineMovement(e,false,_thisImg,_layers,_totalLayers,_shine); 7196 //}); 7197 }); 7198 $(thisImg).parents('.style-5').on('mouseenter', function(e){ 7199 processEnter(e,_thisImg,_layers,_totalLayers,_shine); 7200 }); 7201 $(thisImg).parents('.style-5').on('mouseleave', function(e){ 7202 processExit(e,_thisImg,_layers,_totalLayers,_shine); 7203 }); 7204 })(thisImg,layers,totalLayerElems,shineHTML); 7205 } 7206 7207 //set the depths 7208 (function(_thisImg,_layers,_totalLayers,_shine) { 7209 depths(false,_thisImg,_layers,_totalLayers,_shine); 7210 window.addEventListener('resize', function(e){ 7211 depths(false,_thisImg,_layers,_totalLayers,_shine); 7212 }); 7213 })(thisImg,layers,totalLayerElems,shineHTML); 7214 } 7215 7216 function processMovement(e, touchEnabled, elem, layers, totalLayers, shine){ 7217 7218 //stop raf if exit already called 7219 if(!$(elem.firstChild).hasClass('over')) { processExit(e,elem,layers,totalLayers,shine); return false } 7220 7221 //set up multipliers 7222 7223 if($(elem).parents('.col.wide').length > 0 ) { 7224 var yMult = 0.03; 7225 var xMult = 0.063; 7226 } else if( $(elem).parents('.col.regular').length > 0 ) { 7227 var yMult = 0.045; 7228 var xMult = 0.045; 7229 } else if($(elem).parents('.col.tall').length > 0 ) { 7230 var yMult = 0.05; 7231 var xMult = 0.015; 7232 } else if($(elem).parents('.col.wide_tall').length > 0) { 7233 var yMult = 0.04; 7234 var xMult = 0.04; 7235 } else { 7236 var yMult = 0.045; 7237 var xMult = 0.075; 7238 } 7239 7240 var bdst = bd.scrollTop || htm.scrollTop, 7241 bdsl = bd.scrollLeft, 7242 pageX = (touchEnabled)? e.touches[0].pageX : e.pageX, 7243 pageY = (touchEnabled)? e.touches[0].pageY : e.pageY, 7244 offsets = elem.getBoundingClientRect(), 7245 w = elem.clientWidth || elem.offsetWidth || elem.scrollWidth, // width 7246 h = elem.clientHeight || elem.offsetHeight || elem.scrollHeight, // height 7247 wMultiple = 320/w, 7248 offsetX = 0.52 - (pageX - offsets.left - bdsl)/w, //cursor position X 7249 offsetY = 0.52 - (pageY - offsets.top - bdst)/h, //cursor position Y 7250 dy = (pageY - offsets.top - bdst) - h / 2, //@h/2 = center of container 7251 dx = (pageX - offsets.left - bdsl) - w / 2, //@w/2 = center of container 7252 yRotate = (offsetX - dx)*(yMult * wMultiple), //rotation for container Y 7253 xRotate = (dy - offsetY)*(xMult * wMultiple); //rotation for container X //old 7254 //imgCSS = ' rotateX(' + xRotate + 'deg) rotateY(' + yRotate + 'deg) translateZ(0)'; //img transform 7255 if($(elem).parents('.wide_tall').length == 0 && $(elem).parents('.wide').length == 0 && $(elem).parents('.tall').length == 0) { 7256 var imgCSS = ' perspective('+ w*3 +'px) rotateX(' + xRotate + 'deg) rotateY(' + yRotate + 'deg) translateY('+offsetY*-10+'px) translateX('+offsetX*-10+'px) scale(1.03)'; //img transform 7257 } else { 7258 var imgCSS = ' perspective('+ w*3 +'px) rotateX(' + xRotate + 'deg) rotateY(' + yRotate + 'deg) translateY('+offsetY*-10+'px) translateX('+offsetX*-10+'px) scale(1.013)'; //img transform 7259 }
7260 //imgCSS2 = 'perspective('+ w*3 +'px) rotateX(' + xRotate + 'deg) rotateY(' + yRotate + 'deg) translateZ(0) translateY('+offsetY*-10+'px) translateX('+offsetX*-10+'px)'; //img transform //old 7261 7262 7263 //container transform 7264 if(elem.firstChild.className.indexOf(' over') != -1){ 7265 if($(elem).parents('.portfolio-items.masonry-items').length > 0){ 7266 //imgCSS2 = ' scale3d(1.025,1.025,1.025)'; 7267 } else { 7268 //imgCSS2 = ' scale3d(1.06,1.06,1.06)'; 7269 } 7270 7271 7272 7273 } 7274 7275 //elem.firstChild.style.transform = imgCSS; 7276 $(elem).find('.parallaxImg-container').css('transform',imgCSS); 7277 7278 if(!(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1)) { 7279 $(elem).parents('.parallaxImg-wrap').find('.parallaxImg-shadow').css('transform',imgCSS); 7280 } 7281 //elem.style.transform = imgCSS2; 7282 7283 7284 } 7285 7286 function processShineMovement(e, touchEnabled, elem, layers, totalLayers, shine){ 7287 7288 var bdst = bd.scrollTop || htm.scrollTop, 7289 bdsl = bd.scrollLeft, 7290 pageX = (touchEnabled)? e.touches[0].pageX : e.pageX, 7291 pageY = (touchEnabled)? e.touches[0].pageY : e.pageY, 7292 offsets = elem.getBoundingClientRect(), 7293 w = elem.clientWidth || elem.offsetWidth || elem.scrollWidth, // width 7294 h = elem.clientHeight || elem.offsetHeight || elem.scrollHeight, // height 7295 wMultiple = 320/w, 7296 offsetX = 0.52 - (pageX - offsets.left - bdsl)/w, //cursor position X 7297 offsetY = 0.52 - (pageY - offsets.top - bdst)/h, //cursor position Y 7298 dy = (pageY - offsets.top - bdst) - h / 2, //@h/2 = center of container 7299 dx = (pageX - offsets.left - bdsl) - w / 2, //@w/2 = center of container 7300 yRotate = (offsetX - dx)*(0.040 * wMultiple), //rotation for container Y 7301 xRotate = (dy - offsetY)*(0.070 * wMultiple), //rotation for container X 7302 7303 arad = Math.atan2(dy, dx), //angle between cursor and center of container in RAD 7304 angle = arad * 180 / Math.PI - 90; //convert rad in degrees 7305 7306 7307 //get angle between 0-360 7308 if (angle < 0) { 7309 angle = angle + 360; 7310 } 7311 7312 //gradient angle and opacity for shine 7313 shine.style.background = 'linear-gradient(' + angle + 'deg, rgba(255,255,255,' + (pageY - offsets.top - bdst)/h * 0.3 + ') 0%,rgba(255,255,255,0) 80%)'; 7314 shine.style.transform = 'translateX(' + (offsetX * totalLayers) - 0.1 + 'px) translateY(' + (offsetY * totalLayers) - 0.1 + 'px) '; 7315 7316 7317 } 7318 7319 function processEnter(e, elem, layers, totalLayers, shine){ 7320 //var sAgent = window.navigator.userAgent; 7321 //var Idx = sAgent.indexOf("Edge"); 7322 7323 elem.firstChild.className += ' over'; 7324 elem.className += ' over'; 7325 7326 //if(Idx == -1) { 7327 //$('body').addClass('cssreflections'); 7328 //$(elem).addClass('transition'); 7329 // //var $timeout = setTimeout(function(){ $(elem).removeClass('transition'); },150); 7330 //} else { 7331 $(elem).addClass('transition'); 7332 var $timeout = setTimeout(function(){ $(elem).removeClass('transition'); },200); 7333 //} 7334 7335 //depths(false, elem, layers, totalLayers, shine); 7336 } 7337 7338 function processExit(e, elem, layers, totalLayers, shine){ 7339 7340 var w = elem.clientWidth || elem.offsetWidth || elem.scrollWidth; 7341 var container = elem.firstChild; 7342 7343 container.className = container.className.replace(' over',''); 7344 elem.className = elem.className.replace(' over',''); 7345 $(container).css('transform', 'perspective('+ w*3 +'px) rotateX(0deg) rotateY(0deg) translateZ(0)'); 7346 $(elem).parents('.parallaxImg-wrap').find('.parallaxImg-shadow').css('transform','perspective('+ w*3 +'px) rotateX(0deg) rotateY(0deg) translateZ(0)'); 7347 //elem.style.transform = 'perspective('+ w*3 +'px) rotateX(0deg) rotateY(0deg) translateZ(0) translateX(0) translateY(0)'; 7348 //shine.style.cssText = ''; 7349 7350 //for(var ly=0;ly<totalLayers;ly++){ 7351 //layers[ly].style.transform = ''; 7352 //} 7353 7354 $(elem).addClass('transition'); 7355 var $timeout = setTimeout(function(){ $(elem).removeClass('transition'); },200); 7356 7357 //removeDepths(false, elem, layers, totalLayers, shine); 7358 7359 } 7360 7361 function depths(touchEnabled, elem, layers, totalLayers, shine) { 7362 7363 var w = elem.clientWidth || elem.offsetWidth || elem.scrollWidth; 7364 var revNum = totalLayers; 7365 var container = elem.firstChild; 7366 7367 //set z 7368 for(var ly=0;ly<totalLayers;ly++){ 7369 //layers[ly].style.transform = 'translateX(' + (offsetX * revNum) * ((ly * 2.5) / wMultiple) + 'px) translateY(' + (offsetY * totalLayers) * ((ly * 2.5) / wMultiple) + 'px) translateZ(0)'; 7370 if(ly == 0) $(layers[ly]).css('transform', 'translateZ(0px)'); 7371 else $(layers[ly]).css('transform','translateZ(' +(w*3)/27*(ly*1.1) + 'px) '); 7372 7373 revNum--; 7374 } 7375 7376 totalLayers = totalLayers + 3; 7377 7378 //set perspective from beginning 7379 $(container).css('transform','perspective('+ w*3 +'px)'); 7380 7381 //$(elem).parents('.col').find('.parallaxImg-shine').css('transform','translateZ('+(w*3)/70*(totalLayers*1.1) +'px)'); 7382 } 7383 7384 function removeDepths(touchEnabled, elem, layers, totalLayers, shine) { 7385 7386 var w = elem.clientWidth || elem.offsetWidth || elem.scrollWidth; 7387 var revNum = totalLayers; 7388 7389 //set z 7390 for(var ly=0;ly<totalLayers;ly++){ 7391 7392 if(ly == 0) $(layers[ly]).css('transform', 'translateZ(' +(w*3)/45*(ly*1.1) + 'px) scale(1)'); 7393 else $(layers[ly]).css('transform', 'translateZ(' +(w*3)/45*(ly*1.1) + 'px) scale(1)'); 7394 7395 revNum--; 7396 } 7397 7398 totalLayers = totalLayers + 3; 7399 7400 } 7401 } 7402 7403 style6Img(); 7404 7405 function portfolioDeviceCheck(){ 7406 if($('body').hasClass('mobile') || navigator.userAgent.match(/(iPad|IEMobile)/) ){ 7407 7408 //if using more details 7409 if($('.portfolio-items .col .work-item').find('a:not(".pp")').length > 0){ 7410 $('.portfolio-items .col .work-item').find('a.pp').css('display','none'); 7411 } 7412 7413 //if only using pp 7414 else { 7415 $('.portfolio-items .col .work-item').find('a:not(".pp")').css('display','none'); 7416 } 7417 7418 } else { 7419 $('.portfolio-items .col .work-item').find('a').css('display','inline'); 7420 } 7421 } 7422 7423 7424 //portfolio accent color 7425 function portfolioAccentColor() { 7426 7427 var portfolioSocialColorCss = ''; 7428 7429 $('.portfolio-items .col').each(function(){ 7430 if ($(this).has('[data-project-color]')) { 7431 $(this).find('.work-info-bg, .bottom-meta').css('background-color',$(this).attr('data-project-color')); 7432 7433 //style5 7434 $(this).find('.parallaxImg-rendered-layer .bg-overlay').css('border-color',$(this).attr('data-project-color')); 7435 7436 var $projColor = $(this).attr('data-project-color'); 7437 if($(this).find('.custom-content .nectar-social').length > 0 && $('body[data-button-style="rounded"]') ) portfolioSocialColorCss += 'body[data-button-style="rounded"] .col[data-
7437project-color="'+$projColor+'"] .custom-content .nectar-social > *:hover i { color: '+ $projColor +'!important; } '; 7438 7439 } 7440 }); 7441 7442 if(portfolioSocialColorCss.length > 1) { 7443 7444 var head = document.head || document.getElementsByTagName('head')[0]; 7445 var style = document.createElement('style'); 7446 7447 style.type = 'text/css'; 7448 if (style.styleSheet){ 7449 style.styleSheet.cssText = portfolioSocialColorCss; 7450 } else { 7451 style.appendChild(document.createTextNode(portfolioSocialColorCss)); 7452 } 7453 7454 head.appendChild(style); 7455 } 7456 } 7457 portfolioAccentColor(); 7458 7459 //portfolio sort 7460 $('body').on('mouseenter','.portfolio-filters',function(){ 7461 $(this).find('> ul').stop(true,true).slideDown(500,'easeOutExpo'); 7462 $(this).find('a#sort-portfolio span').html($(this).find('a#sort-portfolio').attr('data-sortable-label')); 7463 }); 7464 7465 $('body').on('mouseleave','.portfolio-filters',function(){ 7466 var $activeCat = $(this).find('a.active').html(); 7467 if( typeof $activeCat == 'undefined' || $activeCat.length == 0) $activeCat = $(this).attr('data-sortable-label'); 7468 $(this).find('a#sort-portfolio span').html($activeCat); 7469 $(this).find('> ul').stop(true,true).slideUp(500,'easeOutExpo'); 7470 }); 7471 7472 //portfolio selected category 7473 $('body').on('click','.portfolio-filters ul li a', function(){ 7474 $(this).parents('.portfolio-filters').find('#sort-portfolio span').html($(this).html()); 7475 }); 7476 7477 //inline portfolio selected category 7478 $('body').on('click','.portfolio-filters-inline ul li a',function(){ 7479 7480 $(this).parents('ul').find('li a').removeClass('active'); 7481 $(this).addClass('active'); 7482 $(this).parents('.portfolio-filters-inline').find('#current-category').html($(this).html()); 7483 7484 }); 7485 7486 7487 function portfolioFiltersInit() { 7488 //mobile sort menu fix 7489 if($('body').hasClass('mobile') || navigator.userAgent.match(/(iPad|IEMobile)/)){ 7490 $('.portfolio-filters').unbind('mouseenter mouseleave'); 7491 $('.portfolio-filters > a, .portfolio-filters ul li a').click(function(e){ 7492 if(e.originalEvent !== undefined) $(this).parents('.portfolio-filters').find('> ul').stop(true,true).slideToggle(600,'easeOutCubic'); 7493 }); 7494 } 7495 7496 $('.portfolio-filters-inline .container > ul > li:nth-child(2) a').click(); 7497 7498 //portfolio more details page menu highlight 7499 $('body.single-portfolio #header-outer nav > ul > li > a:contains("Portfolio")').parents('li').addClass('current-menu-item'); 7500 7501 //blog page highlight 7502 $('body.single-post #header-outer nav > ul > li > a:contains("Blog")').parents('li').addClass('current-menu-item'); 7503 } 7504 7505 portfolioFiltersInit(); 7506 7507 7508 //blog love center 7509 function centerLove(){ 7510 $('.post').each(function(){ 7511 7512 var $loveWidth = $(this).find('.post-meta .nectar-love').outerWidth(); 7513 var $loveWrapWidth = $(this).find('.post-meta .nectar-love-wrap').width(); 7514 7515 //center 7516 $(this).find('.post-meta .nectar-love').css('margin-left', $loveWrapWidth/2 - $loveWidth/2 + 'px' ); 7517 $(this).find('.nectar-love-wrap').css('visibility','visible'); 7518 }); 7519 } 7520 7521 $('.nectar-love').on('click',function(){ 7522 centerLove(); 7523 }); 7524 7525 centerLove(); 7526 7527 7528 //portfolio single comment order 7529 function portfolioCommentOrder(){ 7530 7531 if($('body').hasClass('mobile') && $('body').hasClass('single-portfolio') && $('#respond').length > 0){ 7532 $('#sidebar').insertBefore('.comments-section'); 7533 } 7534 7535 else if($('body').hasClass('single-portfolio') && $('#respond').length > 0) { 7536 $('#sidebar').insertAfter('#post-area'); 7537 } 7538 7539 } 7540 7541 portfolioCommentOrder(); 7542 7543 7544 //portfolio sidebar follow 7545 7546 var sidebarFollow = $('.single-portfolio #sidebar').attr('data-follow-on-scroll'); 7547 7548 function portfolioSidebarFollow(){ 7549 7550 sidebarFollow = $('.single-portfolio #sidebar').attr('data-follow-on-scroll'); 7551 7552 if( $('body.single-portfolio').length > 0 && sidebarFollow == 1 && !$('body').hasClass('mobile') && parseInt($('#sidebar').height()) + 50 <= parseInt($('#post-area').height())) { 7553 7554 $('#sidebar').addClass('fixed-sidebar'); 7555 7556 var $footer = ($('.comment-wrap.full-width-section').length == 0) ? '#footer-outer' : '.comment-wrap'; 7557 if( $('#call-to-action').length > 0 ) $footer = '#call-to-action'; 7558 7559 //convert width into px 7560 sidebarPxConversion(); 7561 7562 $('#sidebar').stickyMojo({footerID: $footer, contentID: '#post-area'});
7563 7564 } 7565 7566 } 7567 7568 function sidebarPxConversion(){ 7569 7570 if( $('body.single-portfolio').length > 0 && sidebarFollow == 1 && !$('body').hasClass('mobile') ) { 7571 7572 var $containerWidth = $('.main-content > .row').width(); 7573 var $sidebarWidth = $containerWidth*.235; 7574 7575 if(window.innerWidth > 1300){ 7576 $sidebarWidth = $containerWidth*.235; 7577 } else if(window.innerWidth < 1300 && window.innerWidth > 1000 ) { 7578 $sidebarWidth = $containerWidth*.273; 7579 } 7580 7581 $('#sidebar').css('width',$sidebarWidth+'px'); 7582 } 7583 } 7584 7585 $(window).load(function(){ 7586 setTimeout(portfolioSidebarFollow,200); 7587 }); 7588 7589 7590 //remove the portfolio filters that are not found in the current page 7591 function isotopeCatSelection() { 7592 7593 7594 $('.portfolio-items:not(".carousel")').each(function(){ 7595 7596 var isotopeCatArr = []; 7597 var $portfolioCatCount = 0; 7598 $(this).parent().parent().find('div[class^=portfolio-filters] ul li').each(function(i){ 7599 if($(this).find('a').length > 0) { 7600 isotopeCatArr[$portfolioCatCount] = $(this).find('a').attr('data-filter').substring(1); 7601 $portfolioCatCount++; 7602 } 7603 }); 7604 7605 ////ice the first (all) 7606 isotopeCatArr.shift(); 7607 7608 7609 var itemCats = ''; 7610 7611 $(this).find('> div').each(function(i){ 7612 itemCats += $(this).attr('data-project-cat'); 7613 }); 7614 itemCats = itemCats.split(' '); 7615 7616 ////remove the extra item on the end of blank space 7617 itemCats.pop(); 7618 7619 ////make sure the array has no duplicates 7620 itemCats = $.unique(itemCats); 7621 7622 ////if user has chosen a set of filters to display - only show those 7623 if($(this).attr('data-categories-to-show').length != 0 && $(this).attr('data-categories-to-show') != 'all') { 7624 $userSelectedCats = $(this).attr('data-categories-to-show').replace(/,/g , ' '); 7625 $userSelectedCats = $userSelectedCats.split(' '); 7626 7627 if(!$(this).hasClass('infinite_scroll')) $(this).removeAttr('data-categories-to-show'); 7628 } else { 7629 $userSelectedCats = itemCats; 7630 } 7631 7632 7633 ////Find which categories are actually on the current page 7634 var notFoundCats = []; 7635 $.grep(isotopeCatArr, function(el) { 7636 7637 if ($.inArray(el, itemCats) == -1) notFoundCats.push(el); 7638 if ($.inArray(el, $userSelectedCats) == -1) notFoundCats.push(el); 7639 7640 }); 7641 7642 //manipulate the list 7643 if(notFoundCats.length != 0){ 7644 $(this).parent().parent().find('div[class^=portfolio-filters] ul li').each(function(){ 7645 if($(this).find('a').length > 0) { 7646 if( $.inArray($(this).find('a').attr('data-filter').substring(1), notFoundCats) != -1 ){ 7647 $(this).hide(); 7648 } else { 7649 $(this).show(); 7650 } 7651 } 7652 }) 7653 } 7654 }); 7655 } 7656 7657 isotopeCatSelection(); 7658 7659 7660 //sharing buttons 7661 /*jQuery.sharedCount = function(url, fn) { 7662 url = encodeURIComponent(url || location.href); 7663 var arg = { 7664 url: "//" + (location.protocol == "https:" ? "sharedcount.appspot" : "api.sharedcount") + ".com/?url=" + url, 7665 cache: true, 7666 dataType: "json" 7667 }; 7668 if ('withCredentials' in new XMLHttpRequest) { 7669 arg.success = fn; 7670 } 7671 else { 7672 var cb = "sc_" + url.replace(/\W/g, ''); 7673 window[cb] = fn; 7674 arg.jsonpCallback = cb; 7675 arg.dataType += "p"; 7676 } 7677 return jQuery.ajax(arg); 7678 };*/ 7679 7680 7681 7682 7683 var completed = 0; 7684 var windowLocation = window.location.href.replace(window.location.hash, ''); 7685 7686 function facebookShare(){ 7687 windowLocation = window.location.href.replace(window.location.hash, ''); 7688 window.open( 'https://www.facebook.com/sharer/sharer.php?u='+windowLocation, "facebookWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ) 7689 return false; 7690 } 7691 7692 function googlePlusShare(){ 7693 windowLocation = window.location.href.replace(window.location.hash, ''); 7694 window.open( 'https://plus.google.com/share?url='+windowLocation, "googlePlusWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ) 7695 return false; 7696 } 7697 7698 function twitterShare(){ 7699 windowLocation = window.location.href.replace(window.location.hash, ''); 7700 if($(".section-title h1").length > 0) { 7701 var $pageTitle = encodeURIComponent($(".section-title h1").text()); 7702 } else { 7703 var $pageTitle = encodeURIComponent($(document).find("title").text()); 7704 } 7705 window.open( 'http://twitter.com/intent/tweet?text='+$pageTitle +' '+windowLocation, "twitterWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ) 7706 return false; 7707 } 7708 7709 function wooTwitterShare(){ 7710 windowLocation = window.location.href.replace(window.location.hash, ''); 7711 window.open( 'http://twitter.com/intent/tweet?text='+$("h1.product_title").text() +' '+windowLocation, "twitterWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ) 7712 return false; 7713 } 7714
7715 function linkedInShare(){ 7716 windowLocation = window.location.href.replace(window.location.hash, ''); 7717 if($(".section-title h1").length > 0) { 7718 var $pageTitle = encodeURIComponent($(".section-title h1").text()); 7719 } else { 7720 var $pageTitle = encodeURIComponent($(document).find("title").text()); 7721 } 7722 window.open( 'http://www.linkedin.com/shareArticle?mini=true&url='+windowLocation+'&title='+$pageTitle+'', "linkedInWindow", "height=480,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ) 7723 return false; 7724 } 7725 7726 function woolinkedInShare(){ 7727 windowLocation = window.location.href.replace(window.location.hash, ''); 7728 window.open( 'http://www.linkedin.com/shareArticle?mini=true&url='+windowLocation+'&title='+$("h1.product_title").text(), "twitterWindow", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ) 7729 return false; 7730 } 7731 7732 function pinterestShare(){ 7733 windowLocation = window.location.href.replace(window.location.hash, ''); 7734 var $sharingImg = ($('.single-portfolio').length > 0 && $('div[data-featured-img]').attr('data-featured-img') != 'empty' ) ? $('div[data-featured-img]').attr('data-featured-img') : $('#ajax-content-wrap img').first().attr('src'); 7735 7736 if($(".section-title h1").length > 0) { 7737 var $pageTitle = encodeURIComponent($(".section-title h1").text()); 7738 } else { 7739 var $pageTitle = encodeURIComponent($(document).find("title").text()); 7740 } 7741 7742 window.open( 'http://pinterest.com/pin/create/button/?url='+windowLocation+'&media='+$sharingImg+'&description='+$pageTitle, "pinterestWindow", "height=640,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ) 7743 return false; 7744 } 7745 7746 function wooPinterestShare(){ 7747 $imgToShare = ($('img.attachment-shop_single').length > 0) ? $('img.attachment-shop_single').first().attr('src') : $('.single-product-main-image img').first().attr('src'); 7748 windowLocation = window.location.href.replace(window.location.hash, ''); 7749 window.open( 'http://pinterest.com/pin/create/button/?url='+windowLocation+'&media='+$imgToShare+'&description='+$('h1.product_title').text(), "pinterestWindow", "height=640,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ) 7750 return false; 7751 } 7752 7753 7754 function socialFade(){ 7755 if(completed == $('a.nectar-sharing').length && $('a.nectar-sharing').parent().hasClass('in-sight')) { 7756 7757 //$timeout = ($('#page-header-bg[data-animate-in-effect="slide-down"] .nectar-social').length > 0 ) ? 500 : 1; 7758 // setTimeout(function(){ 7759 //$('.nectar-social > a').stop(true,true).transition({'padding-right':'15px'},350,'easeOutSine'); 7760 7761 //love fadein 7762 $('.nectar-social .nectar-love span').show(350,'easeOutSine',function(){ 7763 $(this).stop().animate({'opacity':1},800); 7764 }); 7765 7766 //sharing loadin 7767 $('.nectar-social > a').each(function(i){ 7768 var $that = $(this); 7769 7770 $(this).find('> span').show(350,'easeOutSine',function(){ 7771 $that.find('> span').stop().animate({'opacity':1},800); 7772 }); 7773 7774 }); 7775 //},$timeout); 7776 7777 //alt blog layout total share count 7778 var $totalShares = 0; 7779 $('.nectar-social > a .count').each(function(){ 7780 $totalShares += parseInt($(this).html()); 7781 }); 7782 7783 if($totalShares != 1){ 7784 $('.single .meta-share-count .plural').css({'opacity':'1', 'display':'inline'}); 7785 $('.single .meta-share-count .singular').remove(); 7786 } else { 7787 $('.single .meta-share-count .singular').css({'opacity':'1', 'position':'relative', 'display':'inline'}); 7788 $('.single .meta-share-count .plural').remove(); 7789 } 7790 7791 $('.meta-share-count .share-count-total').html($totalShares).css('opacity',1); 7792 } 7793 } 7794 7795 $('body').on('click','#single-below-header .nectar-social a', function(){ return false; }); 7796 7797 $('body').on('click','.facebook-share:not(.inactive)', facebookShare); 7798 $('body').on('click','.google-plus-share:not(.inactive)', googlePlusShare); 7799 $('body').on('click','.nectar-social:not(".woo") .twitter-share:not(.inactive)', twitterShare); 7800 $('body').on('click','.nectar-social.woo .twitter-share', wooTwitterShare); 7801 $('body').on('click','.nectar-social:not(".woo") .linkedin-share:not(.inactive)', linkedInS
7801hare); 7802 $('body').on('click','.nectar-social.woo .linkedin-share', woolinkedInShare); 7803 $('body').on('click','.nectar-social:not(".woo") .pinterest-share:not(.inactive)', pinterestShare); 7804 $('body').on('click','.nectar-social.woo .pinterest-share', wooPinterestShare); 7805 7806 7807 function socialSharingInit() { 7808 7809 //mobile fullscreen blog class for click event fix 7810 if($('body').hasClass('mobile') && $('.single-post .fullscreen-header').length > 0) { 7811 $('#single-below-header .nectar-social .nectar-sharing, #single-below-header .nectar-social .nectar-sharing-alt').addClass('inactive'); 7812 } 7813 7814 completed = 0; 7815 7816 if( $('a.facebook-share').length > 0 || $('a.twitter-share').length > 0 || $('a.google-plus-share').length > 0 || $('a.linkedin-share').length > 0 || $('a.pinterest-share').length > 0) { 7817 7818 7819 ////facebook 7820 if($('a.facebook-share:not(.sharing-default-minimal a.facebook-share)').length > 0 && $('body[data-button-style="rounded"]').length == 0 || $('#project-meta a.facebook-share').length > 0 || $('#single-meta a.facebook-share').length > 0 || $('#single-below-header .facebook-share').length > 0) { 7821 7822 //load share count on load 7823 $.getJSON("https://graph.facebook.com/?id="+ windowLocation +'&callback=?', function(data) { 7824 if((data.shares != 0) && (data.shares != undefined) && (data.shares != null)) { 7825 $('.facebook-share a span.count, a.facebook-share span.count').html( data.shares ); 7826 } 7827 else { 7828 $('.facebook-share a span.count, a.facebook-share span.count').html( 0 ); 7829 } 7830 completed++; 7831 socialFade(); 7832 }); 7833 7834 7835 7836 } else if($('a.facebook-share').length > 0 && $('body[data-button-style="rounded"]').length > 0 || $('.sharing-default-minimal a.facebook-share').length > 0) { 7837 completed++; 7838 socialFade(); 7839 } 7840 7841 7842 ////twitter 7843 if($('a.twitter-share:not(.sharing-default-minimal a.twitter-share)').length > 0 && $('body[data-button-style="rounded"]').length == 0 || $('#project-meta a.twitter-share').length > 0 || $('#single-meta a.twitter-share').length > 0 || $('#single-below-header .twitter-share').length > 0) { 7844 //load tweet count on load 7845 //$.getJSON('https://cdn.api.twitter.com/1/urls/count.json?url='+windowLocation+'&callback=?', function(data) { 7846 // if((data.count != 0) && (data.count != undefined) && (data.count != null)) { 7847 // $('.twitter-share a span.count, a.twitter-share span.count').html( data.count ); 7848 //} 7849 //else { 7850 $('.twitter-share a span.count, a.twitter-share span.count').html( 0 ); 7851 //} 7852 completed++; 7853 socialFade(); 7854 //}); 7855 7856 7857 } else if($('a.twitter-share').length > 0 && $('body[data-button-style="rounded"]').length > 0 || $('.sharing-default-minimal a.twitter-share').length > 0 ) { 7858 completed++; 7859 socialFade(); 7860 } 7861 7862 7863 ////linkedIn 7864 if($('a.linkedin-share:not(.sharing-default-minimal a.linkedin-share)').length > 0 && $('body[data-button-style="rounded"]').length == 0 || $('#project-meta a.linkedin-share').length > 0 || $('#single-meta a.linkedin-share').length > 0 || $('#single-below-header .linkedin-share').length > 0) { 7865 //load share count on load 7866 //$.getJSON('https://www.linkedin.com/countserv/count/share?url='+windowLocation+'&callback=', function(data) { 7867 // if((data.count != 0) && (data.count != undefined) && (data.count != null)) { 7868 // $('.linkedin-share a span.count, a.linkedin-share span.count').html( data.count ); 7869 // } 7870 // else { 7871 $('.linkedin-share a span.count, a.linkedin-share span.count').html( 0 ); 7872 // } 7873 completed++; 7874 socialFade(); 7875 //}); 7876 7877 7878 } else if($('a.linkedin-share').length > 0 && $('body[data-button-style="rounded"]').length > 0 || $('.sharing-default-minimal a.linkedin-share').length > 0) { 7879 completed++; 7880 socialFade(); 7881 } 7882 7883 7884 ////pinterest 7885 if($('a.pinterest-share:not(.sharing-default-minimal a.pinterest-share)').length > 0 && $('body[data-button-style="rounded"]').length == 0 || $('#project-meta a.pinterest-share').length > 0 || $('#single-meta a.pinterest-share').length > 0 || $('#single-below-header .pinterest-share').length > 0) { 7886 //load pin count on load 7887 $.getJSON('https://api.pinterest.com/v1/urls/count.json?url='+windowLocation+'&callback=?', function(data) { 7888 if((data.count != 0) && (data.count != undefined) && (data.count != null)) { 7889 $('.pinterest-share a span.count, a.pinterest-share span.count').html( data.count ); 7890 } 7891 else { 7892 $('.pinterest-share a span.count, a.pinterest-share span.count').html( 0 ); 7893 } 7894 completed++; 7895 socialFade(); 7896 }); 7897 7898 } else if($('a.pinterest-share').length > 0 && $('body[data-button-style="rounded"]').length > 0 || $('.sharing-default-minimal a.pinterest-share').length > 0) { 7899 completed++; 7900 socialFade(); 7901 7902 } 7903 7904 7905 //fadeIn 7906 $('a.nectar-sharing > span.count, a.nectar-sharing-alt > span.count').hide().css('width','auto'); 7907 7908 7909 //social light up 7910 7911 $('.nectar-social').each(function() { 7912 if($(this).parents('.custom-content').length == 0) { 7913 7914 7915 var $that = $(this); 7916 var waypoint = new Waypoint({ 7917 element: $that, 7918 handler: function(direction) { 7919 7920 $slide_timeout = ($('#page-header-bg[data-animate-in-effect="slide-down"] .nectar-social').length > 0 ) ? 900 : 1; 7921 7922 setTimeout(function(){ 7923 7924 $that.addClass('in-sight'); 7925 socialFade(); 7926 7927 if($('#page-header-bg .nectar-social').length == 0) { 7928 $that.find('> *').each(function(i){ 7929 7930 var $that = $(this); 7931 var $timeout = ($('body[data-button-style="rounded"]').length > 0) ? 0: 750; 7932 7933 setTimeout(function(){ 7934 7935 $that.delay(i*80).queue(function(){ 7936 7937 var $that = $(this); $(this).addClass('hovered'); 7938 7939 setTimeout(function(){ 7940 $that.removeClass('hovered'); 7941 },300); 7942 7943 });
7944 7945 },$timeout); 7946 }); 7947 } 7948 7949 },$slide_timeout ); 7950 7951 $that.addClass('animated-in'); 7952 waypoint.destroy(); 7953 }, 7954 offset: 'bottom-in-view' 7955 7956 }); 7957 7958 7959 7960 } 7961 }); 7962 7963 } 7964 7965 } 7966 7967 socialSharingInit(); 7968 7969 7970 if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) { 7971 7972 var $socialTimeout; 7973 $('body').on('mouseenter','#single-meta .meta-share-count, #project-meta .meta-share-count', function(){ 7974 clearTimeout($socialTimeout); 7975 7976 if($(this).parents('[id*="single-meta"]').length > 0 && $('[data-tab-pos="fullwidth"]').length == 0) 7977 $(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'right':'0px'},0); 7978 else 7979 $(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'left':'0px'},0); 7980 7981 $(this).parents('[id*="-meta"]').addClass('social-hovered'); 7982 7983 $(this).parents('[id*="-meta"]').find('.n-shortcode a, .meta-comment-count a, .meta-share-count > a ').stop(true).animate({'opacity':0},250); 7984 $(this).find('.nectar-social a').each(function(i){ 7985 $(this).stop(true).delay(i*40).animate({'opacity': 1, 'left':'0px'}, 150); 7986 }); 7987 7988 }); 7989 7990 7991 $('body').on('mouseleave','#single-meta .meta-share-count, #project-meta .meta-share-count', function(){ 7992 $(this).parents('[id*="-meta"]').removeClass('social-hovered'); 7993 7994 if($(this).parents('[id*="single-meta"]').length > 0 && $('[data-tab-pos="fullwidth"]').length == 0) 7995 $(this).find('.nectar-social').stop(true).animate({'opacity': 0, 'right':'-20px'}, 200); 7996 else 7997 $(this).find('.nectar-social').stop(true).animate({'opacity': 0, 'left':'-20px'}, 200); 7998 7999 $(this).parents('[id*="-meta"]').find('.n-shortcode a, .meta-comment-count a, .meta-share-count > a ').stop(true).animate({'opacity':1},250); 8000 8001 var $that = $(this); 8002 8003 $socialTimeout = setTimeout(function(){ 8004 $that.find('.nectar-social').hide(); 8005 if($that.parents('[id*="single-meta"]').length > 0 && $('[data-tab-pos="fullwidth"]').length == 0) 8006 $that.find('.nectar-social a').stop(true).animate({'opacity': 0, 'left':'20px'},0); 8007 else 8008 $that.find('.nectar-social a').stop(true).animate({'opacity': 0, 'left':'-20px'},0); 8009 }, 200); 8010 }); 8011 } else { 8012 var $socialTimeout; 8013 $('body').on('click','#single-meta .meta-share-count, #project-meta .meta-share-count', function(){ 8014 clearTimeout($socialTimeout); 8015 8016 if($(this).parents('[id*="single-meta"]').length > 0 && $('[data-tab-pos="fullwidth"]').length == 0) 8017 $(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'right':'0px'},0); 8018 else 8019 $(this).find('.nectar-social').show().stop(true).animate({'opacity': 1, 'left':'0px'},0); 8020 8021 $(this).parents('[id*="-meta"]').addClass('social-hovered'); 8022 8023 $(this).parents('[id*="-meta"]').find('.n-shortcode a, .meta-comment-count a, .meta-share-count > a ').stop(true).animate({'opacity':0},250); 8024 $(this).find('.nectar-social a').each(function(i){ 8025 $(this).stop(true).delay(i*40).animate({'opacity': 1, 'left':'0px'}, 150); 8026 }); 8027 8028 return false; 8029 }); 8030 8031 } 8032 8033 $('body').on('mouseenter','.fullscreen-header .meta-share-count', function(){ 8034 $(this).find('> a, > i').stop(true).animate({'opacity': 0},400); 8035 $(this).find('.nectar-social > *').each(function(i){ 8036 $(this).stop(true).delay(i*50).animate({'opacity':'1', 'top': '0px'},250,'easeOutCubic'); 8037 }); 8038 //allow clickable on mobile 8039 setTimeout(function(){ $('.meta-share-count .nectar-sharing, .meta-share-count .nectar-sharing-alt').removeClass('inactive'); },300); 8040 }); 8041 8042 if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) { 8043 $('body').on('mouseleave','.fullscreen-header .meta-share-count', function(){ 8044 $(this).find('> a, > i').stop(true).animate({'opacity': 1},300,'easeInCubic'); 8045 $(this).find('.nectar-social > *').each(function(i){ 8046 $(this).stop(true).animate({'opacity':'0', 'top': '10px'},200,'easeInCubic'); 8047 }); 8048 }); 8049 } 8050 8051 8052 8053 8054 //full width love center 8055 function nectarLoveFWCenter(){ 8056 $('.nectar-social.full-width').each(function(){ 8057 $(this).find('.n-shortcode .nectar-love').css('padding-top', $(this).find('> a').css('padding-top')); 8058 }); 8059 } 8060 8061 nectarLoveFWCenter(); 8062 8063 8064 //----------------------------------------------------------------- 8065 // NectarLove 8066 //----------------------------------------------------------------- 8067 8068 $('body').on('click','.nectar-love', function() { 8069 8070 8071 var $loveLink = $(this); 8072 var $id = $(this).attr('id'); 8073 var $that = $(this); 8074 8075 if($loveLink.hasClass('loved')) return false; 8076 if($(this).hasClass('inactive')) return false; 8077 8078 var $dataToPass = { 8079 action: 'nectar-love', 8080 loves_id: $id, 8081 love_nonce: nectarLove.loveNonce 8082 } 8083 8084 $.post(nectarLove.ajaxurl, $dataToPass, function(data){ 8085 $loveLink.find('span').html(data); 8086 $loveLink.addClass('loved').attr('title','You already love this!'); 8087 $loveLink.find('span').css({'opacity': 1,'width':'auto'}); 8088 //ascend 8089 if($('body').hasClass('ascend') && $that.parents('.classic_enhanced').length == 0 ){ 8090 $loveLink.find('.icon-salient-heart.loved').show().transition({ scale: 1 },800,'cubic-bezier(0.15, 0.84, 0.35, 1.5)'); 8091 setTimeout(function(){ $loveLink.find('.icon-salient-heart-2').css('opacity','0'); },400); 8092 if($loveLink.parents('.sharing-default-minimal').length > 0 && $loveLink.parents('.bottom-meta').length >0 ) $loveLink.find('.icon-salient-heart-2').remove(); 8093 } else if($that.parents('.classic_enhanced').length > 0 ) { 8094 $that.find('.icon-salient-heart-2').addClass('loved'); 8095 } 8096 }); 8097 8098 $(this).addClass('inactive'); 8099 8100 return false; 8101 }); 8102 8103 8104 8105 //infinite scroll 8106 function infiniteScrollInit() { 8107 8108 if($('.infinite_scroll').length > 0) { 8109 8110 //portfolio 8111 $('.portfolio-items.infinite_scroll').infinitescroll({ 8112 navSelector : "div#pagination", 8113 nextSelector : "div#pagination a:first", 8114 itemSelector : ".portfolio-items.infinite_scroll .element", 8115 finishedMsg: "<em>Congratulations, you've reached the end of the internet.</em>", 8116 msgText: " ", 8117 },function(newElements){ 8118 8119 8120 var $container = $('.portfolio-items.infinite_scroll:not(.carousel)'); 8121 //loading effect 8122 8123 var $newElems = $( newElements ).css('opacity',0); 8124 //// ensure that images load before adding to masonry layout 8125 $newElems.imagesLoaded(function(){ 8126 8127 $( newElements ).css('opacity',1); 8128 8129 $container.isotope( 'appended', $( newElements )); 8130 8131 $( newElements ).find('.work-item').addClass('ajax-loaded'); 8132 $( newElements ).addClass('ajax-loaded');
8133 ///// show elems now they're ready 8134 8135 $(newElements).find('.work-meta, .nectar-love-wrap').css({'opacity':1}); 8136 8137 //keep filtering 8138 if($('.portfolio-filters-inline').length > 0 || $('.portfolio-filters').length > 0) { 8139 8140 if($('.portfolio-filters-inline').length > 0) { 8141 var selector = $('.portfolio-filters-inline a.active').attr('data-filter'); 8142 } else { 8143 var selector = $('.portfolio-filters a.active').attr('data-filter'); 8144 } 8145 8146 $('.portfolio-filters-inline a.active').attr('data-filter'); 8147 $container.isotope({ filter: selector }); 8148 } 8149 8150 //set width 8151 portfolioItemWidths(); 8152 reLayout(); 8153 8154 if($(newElements).find('.work-item.style-5').length > 0) style6Img(); 8155 8156 if($(newElements).find('.inner-wrap').attr('data-animation') == 'none') { 8157 $('.portfolio-items .col .inner-wrap').removeClass('animated'); 8158 } else { 8159 8160 $(newElements).each(function(i){ 8161 8162 $(this).delay(130*i).queue(function(next){ 8163 $(this).addClass("animated-in"); 8164 next(); 8165 }); 8166 8167 }); //each 8168 } 8169 8170 8171 portfolioHoverEffects(); 8172 portfolioAccentColor(); 8173 8174 //verify smooth scorlling 8175 if( $smoothCache == true && $(window).width() > 690 && $('body').outerHeight(true) > $(window).height() && Modernizr.csstransforms3d && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ niceScrollInit(); $(window).trigger('resize') } 8176 8177 8178 //Panr 8179 if(!$('body').hasClass('mobile') && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)) { 8180 8181 $(".portfolio-items:not(.carousel) .work-item.style-3 img").panr({ 8182 scaleDuration: .28 8183 }); 8184 $(".portfolio-items:not(.carousel) .work-item.style-3-alt img").panr({ scaleDuration: .28, sensitivity: 12.6, scaleTo: 1.08, panDuration: 3 }); 8185 8186 } 8187 8188 //prettyphoto 8189 $('.portfolio-items').each(function(){ 8190 var $unique_id = Math.floor(Math.random()*10000); 8191 $(this).find('a[rel^="prettyPhoto"], a.pretty_photo').attr('rel','prettyPhoto['+$unique_id+'_gal]').removeClass('pretty_photo'); 8192 }); 8193 8194 lightBoxInit(); 8195 8196 piVertCenter(); 8197 8198 setTimeout(function(){masonryZindex(); reLayout(); $( newElements ).removeClass('ajax-loaded'); },700); 8199 8200 //recalc the filters 8201 isotopeCatSelection(); 8202 8203 parallaxRowsBGCals(); 8204 8205 }); 8206 8207 8208 8209 8210 8211 }); 8212 8213 8214 8215 //blog 8216 $('#post-area.infinite_scroll .posts-container').infinitescroll({ 8217 navSelector : "div#pagination", 8218 nextSelector : "div#pagination a:first", 8219 itemSelector : "#post-area .posts-container .post", 8220 finishedMsg: "<em>Congratulations, you've reached the end of the internet.</em>", 8221 msgText: " " 8222 },function(newElements){ 8223 8224 if($('.masonry.meta_overlaid').length == 0) { 8225 //reinit js 8226 centerLove(); 8227 8228 //gallery 8229 $(newElements).find('.flex-gallery').each(function(){ 8230 8231 var $that = $(this); 8232 8233 $that.flexslider({ 8234 animation: 'fade', 8235 smoothHeight: false, 8236 animationSpeed: 500, 8237 useCSS: false, 8238 touch: true 8239 }); 8240 8241 ////gallery slider add arrows 8242 $('.flex-gallery .flex-direction-nav li a.flex-next').html('<i class="icon-angle-right"></i>'); 8243 $('.flex-gallery .flex-direction-nav li a.flex-prev').html('<i class="icon-angle-left"></i>'); 8244 8245 }); 8246 8247 8248 //media players 8249 if($().mediaelementplayer) $(newElements).find('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer(); 8250 8251 8252 //lightbox 8253 lightBoxInit(); 8254 8255 //carousels 8256 if($('.carousel').length > 0) { 8257 standardCarouselInit(); 8258 clientsCarouselInit(); 8259 } 8260 8261 //iframes 8262 showLateIframes(); 8263 8264 //milestone 8265 $(newElements).find('.nectar-milestone').each(function() { 8266 //symbol 8267 if($(this).has('[data-symbol]')) { 8268 if($(this).attr('data-symbol-pos') == 'before') { 8269 $(this).find('.number').prepend($(this).attr('data-symbol')); 8270 } else { 8271 $(this).find('.number').append($(this).attr('data-symbol')); 8272 } 8273 } 8274 }); 8275 8276 if(!$('body').hasClass('mobile')) { 8277 8278 $(newElements).find('.nectar-milestone').each(function() { 8279 //animation 8280 8281 var $that = $(this); 8282 var waypoint = new Waypoint({ 8283 element: $that, 8284 handler: function(direction) { 8285 if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 8286 waypoint.destroy(); 8287 return; 8288 } 8289 8290 var $endNum = parseInt($that.find('.number span').text()); 8291 $that.find('.number span').countTo({ 8292 from: 0, 8293 to: $endNum, 8294 speed: 1500, 8295 refreshInterval: 30 8296 });
8297 8298 $that.addClass('animated-in'); 8299 waypoint.destroy(); 8300 }, 8301 offset: 'bottom-in-view' 8302 8303 }); 8304 8305 8306 }); 8307 } 8308 8309 //pie chart 8310 if($().vcChat) $(newElements).find('.vc_pie_chart').vcChat(); 8311 8312 //fancy ul 8313 nectar_fancy_ul_init(); 8314 8315 //testimonial slider 8316 $('.testimonial_slider').animate({'opacity':'1'},800); 8317 createTestimonialControls(); 8318 testimonialSliderHeight(); 8319 testimonialHeightResize(); 8320 8321 //bar graph 8322 $(newElements).find('.nectar-progress-bar').each(function(i){ 8323 8324 8325 var $that = $(this); 8326 var waypoint = new Waypoint({ 8327 element: $that, 8328 handler: function(direction) { 8329 if($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) { 8330 waypoint.destroy(); 8331 return; 8332 } 8333 8334 var percent = $that.find('span').attr('data-width'); 8335 var $endNum = parseInt($that.find('span strong i').text()); 8336 8337 $that.find('span').transition({ 8338 'width' : percent + '%' 8339 },1600, 'easeInOutCirc',function(){ 8340 }); 8341 8342 $that.find('span strong').transition({ 8343 'opacity' : 1 8344 },1350); 8345 8346 8347 $that.find('span strong i').countTo({ 8348 from: 0, 8349 to: $endNum, 8350 speed: 1100, 8351 refreshInterval: 30, 8352 onComplete: function(){ 8353 8354 } 8355 }); 8356 8357 ////100% progress bar 8358 if(percent == '100'){ 8359 $that.find('span strong').addClass('full'); 8360 } 8361 8362 8363 $that.addClass('animated-in'); 8364 waypoint.destroy(); 8365 }, 8366 offset: 'bottom-in-view' 8367 8368 }); 8369 8370 8371 8372 }); 8373 8374 8375 //columns & images with animation 8376 colAndImgAnimations(); 8377 splitLineHeadings(); 8378 8379 setTimeout(function(){ 8380 videoshortcodeSize(); 8381 responsiveVideoIframesInit(); 8382 responsiveVideoIframes(); 8383 $(window).trigger('resize'); 8384 },500); 8385 8386 8387 parallaxRowsBGCals(); 8388 8389 $(window).trigger('resize'); 8390 8391 }//non meta overlaid style 8392 else { 8393 parallaxRowsBGCals(); 8394 8395 $(window).trigger('resize'); 8396 } 8397 8398 // trigger Masonry as a callback 8399 var $container = $('.posts-container'); 8400 if($container.parent().hasClass('masonry')) { 8401 8402 $(newElements).addClass('masonry-blog-item'); 8403 $(newElements).prepend('<span class="bottom-line"></span>'); 8404 8405 //move the meta to the bottom 8406 $(newElements).each(function(){ 8407 8408 var $metaClone = $(this).find('.post-meta').clone(); 8409 8410 $(this).find('.post-meta').remove(); 8411 8412 if($('#post-area.meta_overlaid').length > 0){ 8413 $(this).find('.post-header h2').after($metaClone); 8414 } else { 8415 $(this).find('.content-inner').after($metaClone); 8416 } 8417 8418 }); 8419 8420 }//if masonry 8421 8422 8423 //loading effect 8424 8425 //// hide new items while they are loading 8426 var $newElems = $( newElements ); 8427 //// ensure that images load before adding to masonry layout 8428 8429 if($newElems.find('img').length == 0) $newElems = $('body'); 8430 8431 $newElems.imagesLoaded(function(){ 8432 8433 $container.isotope( 'appended', $( newElements )); 8434 8435 flickityBlogInit(); 8436 8437 $( newElements ).addClass('ajax-loaded');
8438 ///// show elems now they're ready 8439 8440 8441 //classic enhanced specific 8442 if($container.parent().hasClass('classic_enhanced')){ 8443 $container.find('.large_featured.has-post-thumbnail.ajax-loaded .post-featured-img, .wide_tall.has-post-thumbnail.ajax-loaded .post-featured-img').each(function(){ 8444 var $src = $(this).find('img').attr('src'); 8445 $(this).css('background-image','url('+$src+')'); 8446 }); 8447 8448 $container.find('.large_featured.ajax-loaded .nectar-flickity, .wide_tall.ajax-loaded .nectar-flickity').each(function(){ 8449 8450 $(this).find('.cell').each(function(){ 8451 var $src = $(this).find('img').attr('src'); 8452 $(this).css('background-image','url('+$src+')'); 8453 }); 8454 8455 }); 8456 } 8457 8458 8459 if($(newElements).parents('.posts-container').attr('data-animation') == 'none') { 8460 $( newElements ).find('.inner-wrap').removeClass('animated'); 8461 } else { 8462 8463 $(newElements).each(function(i){ 8464 8465 $(this).delay(130*i).queue(function(next){ 8466 $(this).addClass("animated-in"); 8467 next(); 8468 }); 8469 8470 }); //each 8471 } 8472 8473 setTimeout(function(){$( newElements ).removeClass('ajax-loaded'); },700); 8474 8475 8476 }); 8477 8478 8479 8480 }); 8481 8482 } 8483 8484} 8485 8486infiniteScrollInit(); 8487 8488function destroyInfiniteScroll(){ 8489 $('#post-area.infinite_scroll .posts-container').infinitescroll('destroy'); 8490 $('.portfolio-items.infinite_scroll').infinitescroll('destroy'); 8491} 8492
8493/*-------------------------------------------------------------------------*/ 8494/* 6. Scroll to top 8495/*-------------------------------------------------------------------------*/ 8496 8497var $scrollTop = $(window).scrollTop(); 8498 8499//starting bind 8500function toTopBind() { 8501 if( $('#to-top').length > 0 && $(window).width() > 1020 || $('#to-top').length > 0 && $('#to-top.mobile-enabled').length > 0 ) { 8502 8503 if($scrollTop > 350){ 8504 $(window).on('scroll',hideToTop); 8505 } 8506 else { 8507 $(window).on('scroll',showToTop); 8508 } 8509 } 8510} 8511toTopBind(); 8512 8513function showToTop(){ 8514 8515 if( $scrollTop > 350 && $('#slide-out-widget-area.fullscreen.open').length == 0){ 8516 8517 $('#to-top').stop().transition({ 8518 'bottom' : '17px' 8519 },350,'easeInOutCubic'); 8520 8521 $(window).off('scroll',showToTop); 8522 $(window).on('scroll',hideToTop); 8523 } 8524 8525} 8526 8527function hideToTop(){ 8528 8529 if( $scrollTop < 350 || $('#slide-out-widget-area.fullscreen.open').length > 0){ 8530 8531 $animationTiming = ($('#slide-out-widget-area.fullscreen.open').length > 0) ? 1150 : 350; 8532 8533 $('#to-top').stop().transition({ 8534 'bottom' : '-30px' 8535 },$animationTiming,'easeInOutQuint'); 8536 8537 $(window).off('scroll',hideToTop); 8538 $(window).on('scroll',showToTop); 8539 8540 } 8541} 8542 8543 8544//to top color 8545if( $('#to-top').length > 0 ) { 8546 8547 var $windowHeight, $pageHeight, $footerHeight, $ctaHeight; 8548 8549 function calcToTopColor(){ 8550 $scrollTop = $(window).scrollTop(); 8551 $windowHeight = $(window).height(); 8552 $pageHeight = $('body').height(); 8553 $footerHeight = $('#footer-outer').height(); 8554 $ctaHeight = ($('#call-to-action').length > 0) ? $('#call-to-action').height() : 0; 8555 8556 if( ($scrollTop-35 + $windowHeight) >= ($pageHeight - $footerHeight) && $('#boxed').length == 0){ 8557 $('#to-top').addClass('dark'); 8558 } 8559 8560 else { 8561 $('#to-top').removeClass('dark'); 8562 } 8563 } 8564 8565 //calc on scroll 8566 $(window).scroll(calcToTopColor); 8567 8568 //calc on resize 8569 $(window).resize(calcToTopColor); 8570 8571} 8572 8573//alt style 8574if($('body[data-button-style="rounded"]').length > 0){ 8575 var $clone = $('#to-top .icon-angle-up').clone(); 8576 $clone.addClass('top-icon'); 8577 $('#to-top').prepend($clone) 8578} 8579 8580//scroll up event 8581$('body').on('click','#to-top, a[href="#top"]',function(){ 8582 $('body,html').stop().animate({ 8583 scrollTop:0 8584 },800,'easeOutQuad',function(){ 8585 if($('.nectar-box-roll').length > 0) { 8586 $('body').trigger('mousewheel', [1, 0, 0]); 8587 } 8588 }) 8589 return false; 8590}); 8591 8592 8593/* one page scrolling */ 8594function scrollSpyInit(){ 8595 8596 //remove full page URLs from hash if located on same page to fix current menu class 8597 //if(location.pathname.length > 1) { 8598 $("#header-outer a[href*='" + location.pathname + "']").each(function(){ 8599 var $href = $(this).attr('href'); 8600 8601 if($href.indexOf("#") != -1 && $('div'+$href.substr($href.indexOf("#"))).length > 0 ) { 8602 $(this).attr('href',$href.substr($href.indexOf("#"))); 8603 $(this).parent().removeClass('current_page_item').removeClass('current-menu-item'); 8604 } 8605 }); 8606 //} 8607 8608 $target = ($('.page-submenu[data-sticky="true"]').length == 0) ? '#header-outer nav': '.page-submenu'; 8609 $('body').scrollspy({ 8610 target: $target, 8611 offset: $('#header-outer').height() + adminBarHeight + 40 8612 }); 8613 8614} 8615 8616function pageLoadHash() { 8617 var $hash = window.location.hash; 8618 if($hash && $($hash).length > 0) { 8619 8620 $timeoutVar = 0; 8621 if($('.nectar-box-roll').length > 0 && $('.container-wrap.bottomBoxOut').length > 0) { 8622 boxRoll(null,-1); 8623 $timeoutVar = 2050; 8624 } 8625 setTimeout(function(){ 8626 8627 if( $('body[data-permanent-transparent="1"]').length == 0 ) { 8628 8629 if(!$('body').hasClass('mobile')){ 8630 $resize = ($('#header-outer[data-header-resize="0"]').length > 0) ? 0 : parseInt(shrinkNum) + headerPadding2*2; 8631 var $scrollTopDistance = $($hash).offset().top - parseInt($('#header-space').height()) +$resize + 3 - adminBarHeight; 8632 } else { 8633 var $scrollTopDistance = ($('#header-outer[data-mobile-fixed="1"]').length > 0) ? $($hash).offset().top + 2 - $('#header-space').height() + adminBarHeight : $($hash).offset().top - adminBarHeight + 1; 8634 } 8635 8636 } else { 8637 var $scrollTopDistance = $($hash).offset().top - adminBarHeight + 1; 8638 } 8639 8640 var $pageSubMenu = ($('.page-submenu[data-sticky="true"]').length > 0) ? $('.page-submenu').height() : 0; 8641 8642 $('body,html').stop().animate({ 8643 scrollTop: $scrollTopDistance - $pageSubMenu 8644 },800,'easeInOutCubic'); 8645 8646 },$timeoutVar); 8647 } 8648} 8649 8650if($('body[data-animated-anchors="true"]').length > 0) { 8651 8652 8653+ function(t) { 8654 "use strict"; 8655 8656 function s(e, i) { 8657 var r = t.proxy(this.process, this); 8658 this.$body = t("body"), this.$scrollElement = t(t(e).is("body") ? window : e), this.options = t.extend({}, s.DEFAULTS, i), this.selector = (this.options.target || "") + " ul li > a", this.offsets = [], this.targets = [], this.activeTarget = null, this.scrollHeight = 0, this.$scrollElement.on("scroll.bs.scrollspy", r), this.refresh(), this.process() 8659 } 8660 8661 function e(e) { 8662 return this.each(function() { 8663 var i = t(this), 8664 r = i.data("bs.scrollspy"), 8665 o = "object" == typeof e && e; 8666 r || i.data("bs.scrollspy", r = new s(this, o)), "string" == typeof e && r[e]() 8667 }) 8668 } 8669 s.VERSION = "3.2.0", s.DEFAULTS = { 8670 offset: 10 8671 }, s.prototype.getScrollHeight = function() { 8672 return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) 8673 }, s.prototype.refresh = function() { 8674 var s = "offset", 8675 e = 0; 8676 t.isWindow(this.$scrollElement[0]) || (s = "position", e = this.$scrollElement.scrollTop()), this.offsets = [], this.targets = [], this.scrollHeight = this.get
8676ScrollHeight(); 8677 var i = this; 8678 this.$body.find(this.selector).map(function() { 8679 var i = t(this), 8680 r = i.data("target") || i.attr("href"), 8681 o = /^#./.test(r) && t(r); 8682 return o && o.length && o.is(":visible") && [ 8683 [o[s]().top + e, r] 8684 ] || null 8685 }).sort(function(t, s) { 8686 return t[0] - s[0] 8687 }).each(function() { 8688 i.offsets.push(this[0]), i.targets.push(this[1]) 8689 }) 8690 }, s.prototype.process = function() { 8691 var $pageSubMenu = ($('.page-submenu[data-sticky="true"]').length > 0 && $('body[data-hhun="1"]').length == 0) ? $('.page-submenu').height() : 0; 8692 8693 var t, s = this.$scrollElement.scrollTop() + this.options.offset + $pageSubMenu, 8694 e = this.getScrollHeight(), 8695 i = this.options.offset + e - this.$scrollElement.height() -$pageSubMenu, 8696 r = this.offsets, 8697 o = this.targets, 8698 l = this.activeTarget; 8699 if (this.scrollHeight != e && this.refresh(), s >= i) return l != (t = o[o.length - 1]) && this.activate(t); 8700 if (l && s <= r[0]) return l != (t = o[0]) && this.activate(t); 8701 for (t = r.length; t--;) l != o[t] && s >= r[t] && (!r[t + 1] || s <= r[t + 1]) && this.activate(o[t]) 8702 }, s.prototype.activate = function(s) { 8703 this.activeTarget = s, t(this.selector).parentsUntil(this.options.target, ".current-menu-item").removeClass("current-menu-item").removeClass('sfHover'); 8704 var e = this.selector + '[data-target="' + s + '"],' + this.selector + '[href="' + s + '"]', 8705 i = t(e).parents("li").addClass("current-menu-item"); 8706 i.parent(".dropdown-menu").length && (i = i.closest("li.dropdown").addClass("current-menu-item")), i.trigger("activate.bs.scrollspy") 8707 }; 8708 var i = t.fn.scrollspy; 8709 t.fn.scrollspy = e, t.fn.scrollspy.Constructor = s, t.fn.scrollspy.noConflict = function() { 8710 return t.fn.scrollspy = i, this 8711 } 8712}(jQuery); 8713 8714 8715var shrinkNum = 6; 8716if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num'); 8717headerPadding2 = headerPadding - headerPadding/1.8; 8718 8719setTimeout(scrollSpyInit,200); 8720 8721var $animatedScrollingTimeout; 8722 8723$('body').on('click','#header-outer nav .sf-menu a, #footer-outer .nectar-button, .container-wrap a:not(.wpb_tabs_nav a):not(.woocommerce-tabs a), .swiper-slide .button a, #slide-out-widget-area a, #mobile-menu .container ul li a, #slide-out-widget-area .inner div a',function(e){ 8724 8725 var $hash = $(this).prop("hash"); 8726 8727 $('body').addClass('animated-scrolling'); 8728 clearTimeout($animatedScrollingTimeout); 8729 $animatedScrollingTimeout = setTimeout(function(){ $('body').removeClass('animated-scrolling'); },850); 8730 8731 if($hash && $($hash).length > 0 && $hash != '#top' && $hash != '' && $(this).attr('href').indexOf(window.location.href.split("#")[0]) !== -1 || $(this).is('[href^="#"]') && $hash != '' && $($hash).length > 0 && $hash != '#top') { 8732 8733 //stop scrolling for certain elements 8734 //if($(this).parents('.tabbed').length > 0) return false; 8735 8736 //update hash 8737 if(history.pushState) { 8738 history.pushState(null, null, $hash); 8739 } 8740 else { 8741 location.hash = $hash; 8742 } 8743 8744 if($(this).parents('ul').length > 0) { 8745 $(this).parents('ul').find('li').removeClass('current-menu-item'); 8746 //$(this).parents('li').addClass('current-menu-item'); 8747 } 8748 8749 //side widget area click 8750 if($(this).parents('#slide-out-widget-area').length > 0){ 8751 $('#slide-out-widget-area .slide_out_area_close').trigger('click'); 8752 } 8753 8754 //mobile menu click 8755 if($(this).parents('#mobile-menu').length > 0) $('#toggle-nav').trigger('click'); 8756 var $mobileMenuHeight = ($(this).parents('#mobile-menu').length > 0) ? $(this).parents('#mobile-menu').height() : null; 8757 8758 $timeoutVar = 1; 8759 if($('.nectar-box-roll').length > 0 && $('.container-wrap.bottomBoxOut').length > 0) { 8760 boxRoll(null,-1); 8761 $timeoutVar = 2050; 8762 } 8763 8764 var $that = $(this); 8765 8766 setTimeout(function(){ 8767 8768 //scrolling 8769 var $headerSpace = ($('body[data-permanent-transparent="1"]').length > 0) ? 0 : parseInt($('#header-space').height()); 8770 8771 if( $('body[data-permanent-transparent="1"]').length == 0 ) { 8772 8773 if(!$('body').hasClass('mobile')){ 8774 $resize = ($('#header-outer[data-header-resize="0"]').length > 0) ? 0 : parseInt(shrinkNum) + headerPadding2*2; 8775 var $scrollTopDistance = $($hash).offset().top - $mobileMenuHeight - parseInt($('#header-space').height()) +$resize + 3 - adminBarHeight; 8776 } else { 8777 var $scrollTopDistance = ($('#header-outer[data-mobile-fixed="1"]').length > 0) ? $($hash).offset().top + 2 - $('#header-space').height() + adminBarHeight : $($hash).offset().top - $mobileMenuHeight - adminBarHeight + 1; 8778 } 8779 8780 } else { 8781 var $scrollTopDistance = $($hash).offset().top - adminBarHeight + 1; 8782 } 8783 8784 if($('body[data-hhun="1"]').length > 0) { 8785 //alter offset 8786 if($('#header-outer.detached').length == 0 || $that.parents('.page-submenu[data-sticky="true"]').length > 0) 8787 $scrollTopDistance = $scrollTopDistance + $('#header-space').height(); 8788 8789 //hide top header 8790 if($that.parents('.page-submenu[data-sticky="true"]').length > 0) { 8791 $('#header-outer.detached').addClass('invisible'); 8792 $('.page-submenu').addClass('header-not-visible').css('transform','translateY(0px)'); 8793 } 8794 } 8795 8796 var $pageSubMenu = ($that.parents('.page-submenu[data-sticky="true"]').length > 0) ? $that.parents('.page-submenu').height() : 0; 8797 $('body,html').stop().animate({ 8798 scrollTop: $scrollTopDistance - $pageSubMenu 8799 },800,'easeInOutCubic'); 8800 8801 },$timeoutVar); 8802 8803 8804 e.preventDefault(); 8805 8806 } 8807 8808 if($hash == '#top') { 8809 //side widget area click 8810 if($(this).parents('#slide-out-widget-area').length > 0){ 8811 $('#slide-out-widget-area .slide_out_area_close').trigger('click'); 8812 } 8813 } 8814 8815 8816}); 8817 8818 8819if($('.nectar-box-roll').length == 0) $(window).load(pageLoadHash); 8820 8821} 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 //portfolio colors 8833 if($('.portfolio-items .col .style-3-alt').length > 0 || $('.portfolio-items .col .style-3').length > 0 || $('.portfolio-items .col .style-2').length > 0 || $('.portfolio-items .col .style-5').length > 0 ) { 8834 var portfolioColorCss = ''; 8835 $('.portfolio-items .col').each(function(){ 8836 $titleColor = $(this).attr('data-title-color'); 8837 $subTitleColor = $(this).attr('data-subtitle-color'); 8838 8839 if($titleColor.length > 0 ) portfolioColorCss += '.col[data-title-color="'+$titleColor+'"] .vert-center h3, .portfolio-items[data-ps="6"] .col[data-title-color="'+$titleColor+'"] .work-meta h4 { color: '+$titleColor+'; } '; 8840 if($subTitleColor.length > 0 ) portfolioColorCss += '.col[data-subtitle-color="'+$subTitleColor+'"] .vert-center p, .portfolio-items[data-ps="6"] .col[data-title-color="'+$titleColor+'"] .work-meta p { color: '+$subTitleColor+'; } '; 8841 }); 8842 8843 8844 var head = document.head || document.getElementsByTagName('head')[0]; 8845 var style = document.createElement('style'); 8846 8847 style.type = 'text/css'; 8848 if (style.styleSheet){ 8849 style.styleSheet.cssText = portfolioColorCss; 8850 } else { 8851 style.appendChild(document.createTextNode(portfolioColorCss)); 8852 } 8853 8854 head.appendChild(style); 8855 } 8856 8857 // masonryPortfolio 8858 8859 var $portfolio_containers = []; 8860 8861 $('.portfolio-items:not(.carousel)').each(function(i){ 8862 $portfolio_containers[i] = $(this); 8863 }); 8864 8865 function masonryPortfolioInit() { 8866 8867 $portfolio_containers = []; 8868 $('.portfolio-items:not(.carousel)').each(function(i){ 8869 $portfolio_containers[i] = $(this); 8870 }); 8871 8872 //// cache window 8873 var $window = jQuery(window); 8874 8875 8876 $.each($portfolio_containers,function(i){ 8877 8878 8879 //// start up isotope with default settings 8880 $portfolio_containers[i].imagesLoaded(function(){ 8881 8882 //verify smooth scorlling 8883 if( $smoothCache == true && $(window).width() > 690 && $('body').outerHeight(true) > $(window).height() && Modernizr.csstransforms3d && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ niceScrollInit(); $(window).trigger('resize') } 8884 8885 //transformns enabled logic 8886 var $isoUseTransforms = true; 8887 8888 //Panr 8889 if(!$('body').hasClass('mobile') && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)) { 8890 8891 $(".portfolio-items:not(.carousel) .work-item.style-3 img").panr({ scaleDuration: .28 }); 8892 $(".portfolio-items:not(.carousel) .work-item.style-3-alt img").panr({ scaleDuration: .28, sensitivity: 20, scaleTo: 1.12, panDuration: 1 }); 8893 8894 $isoUseTransforms = true; 8895 8896 } 8897 8898 piVertCenter(); 8899 8900 //initial call to setup isotope 8901 var $layoutMode = ( $portfolio_containers[i].hasClass('masonry-items')) ? 'packery' : 'fitRows'; 8902 var $startingFilter = ($portfolio_containers[i].attr('data-starting-filter') != '' && $portfolio_containers[i].attr('data-starting-filter') != 'default') ? '.' + $portfolio_containers[i].attr('data-starting-filter') : '*'; 8903 8904 reLayout(); 8905 8906 $portfolio_containers[i].isotope({ 8907 itemSelector : '.element', 8908 filter: $startingFilter, 8909 layoutMode: $layoutMode,
8910 transitionDuration: '0.6s', 8911 packery: { 8912 gutter: 0 8913 } 8914 }).isotope( 'layout' ); 8915 8916 8917 if($startingFilter != '*'){ 8918 $('.portfolio-filters ul a[data-filter="'+$startingFilter+'"], .portfolio-filters-inline ul a[data-filter="'+$startingFilter+'"]').click(); 8919 } 8920 8921 //call the reLayout to get things rollin' 8922 masonryZindex(); 8923 setTimeout(function(){masonryZindex(); },800); 8924 $window.resize( reLayout ); 8925 $window.smartresize( function(){ 8926 setTimeout(masonryZindex,700); 8927 }); 8928 8929 //inside fwc fix 8930 if($portfolio_containers[i].parents('.full-width-content').length > 0) { setTimeout(function(){ fullWidthContentColumns(); },200); } 8931 8932 //fadeout the loading animation 8933 $('.portfolio-loading').stop(true,true).fadeOut(200); 8934 8935 //fadeIn items one by one 8936 8937 if($portfolio_containers[i].find('.inner-wrap').attr('data-animation') == 'none') { 8938 $('.portfolio-items .col .inner-wrap').removeClass('animated'); 8939 } else { 8940 8941 $('.portfolio-items').each(function(){ 8942 8943 8944 var $that = $(this); 8945 var waypoint = new Waypoint({ 8946 element: $that, 8947 handler: function(direction) { 8948 8949 $that.find('.col').each(function(i){ 8950 $(this).delay(130*i).queue(function(next){ 8951 $(this).addClass("animated-in"); 8952 next(); 8953 }); 8954 });
8955 8956 waypoint.destroy(); 8957 }, 8958 offset: '90%' 8959 8960 }); 8961 8962 }); //each 8963 } 8964 8965 8966 }); 8967 8968 8969 8970 });//each 8971 8972 8973 8974 } 8975 8976 masonryPortfolioInit(); 8977 8978 8979 var mediaQuerySize; 8980 function reLayout() { 8981 8982 clearTimeout(clearIsoAnimation); 8983 $('.portfolio-items .col').addClass('no-transition'); 8984 clearIsoAnimation = setTimeout(function(){ $('.portfolio-items .col').removeClass('no-transition'); },700); 8985 8986 var windowSize = $window.width(); 8987 var masonryObj; 8988 var masonryObjHolder = []; 8989 8990 //remove double quotes for FF 8991 //if (navigator.userAgent.match('MSIE 8') == null) { 8992 // mediaQuerySize = mediaQuerySize.replace(/"/g, ''); 8993 //} 8994 8995 //user defined cols 8996 var userDefinedColWidth; 8997 8998 $.each($portfolio_containers,function(i){ 8999 9000 if( $portfolio_containers[i].attr('data-user-defined-cols') == 'span4') { 9001 userDefinedColWidth = 3 9002 } 9003 9004 else if( $portfolio_containers[i].attr('data-user-defined-cols') == 'span3') { 9005 userDefinedColWidth = 4 9006 } 9007 9008 var isFullWidth = $portfolio_containers[i].attr('data-col-num') == 'elastic'; 9009 9010 9011 //chrome 33 approved method for getting column sizing 9012 if(window.innerWidth > 1600){ 9013 9014 if($portfolio_containers[i].hasClass('constrain-max-cols')) { 9015 mediaQuerySize = 'four'; 9016 } else { 9017 mediaQuerySize = 'five'; 9018 } 9019 9020 } else if(window.innerWidth <= 1600 && window.innerWidth > 1300){ 9021 mediaQuerySize = 'four'; 9022 } else if(window.innerWidth <= 1300 && window.innerWidth > 990){ 9023 9024 if($portfolio_containers[i].hasClass('constrain-max-cols')) { 9025 mediaQuerySize = 'four'; 9026 } else { 9027 mediaQuerySize = 'three'; 9028 } 9029 9030 } else if(window.innerWidth <= 990 && window.innerWidth > 470){ 9031 mediaQuerySize = 'two'; 9032 } else if(window.innerWidth <= 470){ 9033 mediaQuerySize = 'one'; 9034 } 9035 9036 //boxed 9037 if($('#boxed').length > 0) { 9038 if(window.innerWidth > 1300){ 9039 mediaQuerySize = 'four'; 9040 } else if(window.innerWidth < 1300 && window.innerWidth > 990){ 9041 9042 if($portfolio_containers[i].hasClass('constrain-max-cols')) { 9043 mediaQuerySize = 'four'; 9044 } else { 9045 mediaQuerySize = 'three'; 9046 } 9047 9048 } else if(window.innerWidth < 990){ 9049 mediaQuerySize = 'one'; 9050 } 9051 9052 } 9053 9054 //change masonry columns depending on screen size 9055 switch (mediaQuerySize) { 9056 case 'five': 9057 (isFullWidth) ? colWidth = 5 : colWidth = userDefinedColWidth; 9058 masonryObj = { columnWidth: Math.floor($portfolio_containers[i].width() / parseInt(colWidth)) }; 9059 break; 9060 9061 case 'four': 9062 (isFullWidth) ? colWidth = 4 : colWidth = userDefinedColWidth; 9063 9064 masonryObj = { columnWidth: Math.floor($portfolio_containers[i].width() / parseInt(colWidth)) }; 9065 break; 9066 9067 case 'three': 9068 (isFullWidth) ? colWidth = 3 : colWidth = userDefinedColWidth; 9069 9070 masonryObj = { columnWidth: Math.floor($portfolio_containers[i].width() / parseInt(colWidth)) }; 9071 break; 9072 9073 case 'two': 9074 masonryObj = { columnWidth: Math.floor($portfolio_containers[i].width() / 2) }; 9075 break; 9076 9077 case 'one': 9078 masonryObj = { columnWidth: Math.floor($portfolio_containers[i].width() / 1) }; 9079 break; 9080 } 9081 9082 9083 //set widths 9084 portfolioItemWidths(); 9085 9086 9087 //sizing for large items 9088 if( $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:first:visible').length > 0 || $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="wide"]:first:visible').length > 0 || $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"]:first:visible').length > 0 || $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="wide_tall"]:first:visible').length > 0) { 9089 9090 var multipler = (window.innerWidth > 470) ? 2 : 1; 9091 9092 //reset height for calcs 9093 $itemClassForSizing = 'regular'; 9094 9095 if($portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:first:visible').length == 0 && $portfolio_containers[i].find('.col.elastic-portfolio-item.wide:first:visible').length > 0) { 9096 $itemClassForSizing = 'wide'; 9097 } else if($portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:first:visible').length == 0 && $portfolio_containers[i].find('.col.elastic-portfolio-item.wide_tall:first:visible').length > 0) { 9098 $itemClassForSizing = 'wide_tall'; 9099 multipler = 1; 9100 } else if($portfolio_containers[i].find('.col.elastic-portfolio-item[class*="regular"]:first:visible').length == 0 && $portfolio_containers[i].find('.col.elastic-portfolio-item.tall:first:visible').length > 0) { 9101 $itemClassForSizing = 'tall'; 9102 multipler = 1; 9103 } 9104 9105 $portfolio_containers[i].find('.col.elastic-portfolio-item.'+$itemClassForSizing+' img').css('height','auto'); 9106 9107 var tallColHeight = $portfolio_containers[i].find('.col.elastic-portfolio-item.'+$itemClassForSizing+':first:visible img').height(); 9108 9109 $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"] img, .col.elastic-portfolio-item.wide img, .col.elastic-portfolio-item.regular img').removeClass('auto-height'); 9110 $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"] img:not(.custom-thumbnail)').css('height',(tallColHeight*multipler)); 9111 $portfolio_containers[i].find('.col.elastic-portfolio-item.wide img:not(.custom-thumbnail), .col.elastic-portfolio-item.regular img:not(.custom-thumbnail)').css('height',tallColHeight); 9112 9113 $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"] .parallaxImg').css('height',(tallColHeight*multipler) + parseInt($portfolio_containers[i].find('.col.elastic-portfolio-item').css('padding-bottom'))*2 ); 9114 $portfolio_containers[i].find('.col.elastic-portfolio-item.regular .parallaxImg, .col.elastic-portfolio-item.wide .parallaxImg').css('height',tallColHeight); 9115 9116 } else { 9117 $portfolio_containers[i].find('.col.elastic-portfolio-item[class*="tall"] img, .col.elastic-portfolio-item.wide img, .col.elastic-portfolio-item.regular img').addClass('auto-height'); 9118 } 9119 9120 //non masonry 9121 9122 if($portfolio_containers[i].hasClass('no-masonry') && $portfolio_containers[i].find('.col:first:visible').length > 0 && $portfolio_containers[i].parents('.wpb_gallery').length == 0){ 9123 9124 //reset height for calcs 9125 $portfolio_containers[i].find('.col img').css('height','auto'); 9126 var tallColHeight = $portfolio_containers[i].find('.col:first:visible img').height(); 9127 $portfolio_containers[i].find('.col img:not(.custom-thumbnail)').css('height',tallColHeight); 9128 $portfolio_containers[i].find('.col .parallaxImg').css('height',tallColHeight); 9129 } 9130 9131 9132 masonryObjHolder[i] = masonryObj; 9133 9134 if($portfolio_containers[i].isotope()) $portfolio_containers[i].isotope( 'layout' ); 9135 9136 9137 9138 }); //each 9139 9140 } 9141 9142 function portfolioItemWidths() { 9143 $.each($portfolio_containers,function(i,v){ 9144 var $colSize = 4; 9145 var $mult = (mediaQuerySize == 'one') ? 1 : 2; 9146 if(mediaQuerySize == 'five') $colSize = 5; 9147 if(mediaQuerySize == 'four') $colSize = 4; 9148 if(mediaQuerySize == 'three') $colSize = 3; 9149 if(mediaQuerySize == 'two') $colSize = 2; 9150 if(mediaQuerySize == 'one') $colSize = 1; 9151 if($(v).is('[data-ps="6"]') && $colSize == 5) $colSize = 4; 9152 9153 if($(v).width() % $colSize == 0) { 9154 $(v).find('.elastic-portfolio-item:not(.wide):not(.wide_tall)').css('width',Math.floor($(v).width()/$colSize) +'px'); 9155 $(v).find('.elastic-portfolio-item.wide, .elastic-portfolio-item.wide_tall').css('width',Math.floor($(v).width()/$colSize*$mult) +'px'); 9156 } else { 9157 //find closest number to give 0 9158 for(var i = 1; i<4; i++) { 9159 if(($(v).width() - i) % $colSize == 0) { 9160 $(v).find('.elastic-portfolio-item:not(.wide):not(.wide_tall)').css('width',($(v).width()- i)/$colSize +'px'); 9161 $(v).find('.elastic-portfolio-item.wide, .elastic-portfolio-item.wide_tall').css('width',($(v).width()-i)/$colSize*$mult +'px'); 9162 } 9163 9164 } 9165 } 9166 9167 }); 9168 } 9169 9170 //z-index for masonry 9171 function masonryZindex(){ 9172 9173 //escape if no browser support 9174 if($('body .portfolio-items:not(".carousel") .elastic-portfolio-item').css('left')) { 9175 9176 var $coords = {}; 9177 var $zindexRelation = {}; 9178 9179 $('body .portfolio-items:not(".carousel") .elastic-portfolio-item').each(function(){ 9180 //$coords[$(this).index()] = $(this).css('left').substring(0, $(this).css('left').length - 2); 9181 $(this).css('z-index',Math.abs(Math.floor($(this).offset().left/20))); 9182 }); 9183 9184 /*var $corrdsArr = $.map($coords, function (value) { return value; }); 9185 9186 $corrdsArr = removeDuplicates($corrdsArr); 9187 $corrdsArr.sort(function(a,b){return a-b});
9188 9189 for(var i = 0; i < $corrdsArr.length; i++){ 9190 $zindexRelation[$corrdsArr[i]] = i*10; 9191 } 9192 9193 $.each($coords,function(k,v){ 9194 9195 var $zindex; 9196 var $coordCache = v; 9197 $.each($zindexRelation,function(k,v){ 9198 if($coordCache == k) { 9199 $zindex = v; 9200 } 9201 }); 9202 9203 $('body .portfolio-items:not(".carousel") .elastic-portfolio-item:eq('+k+')').css('z-index',$zindex); 9204 });*/ 9205 9206 } 9207 9208 9209 } 9210 9211 function blogMasonryZindex(){ 9212 9213 //escape if no browser support 9214 if($('body .masonry.meta_overlaid .masonry-blog-item').css('left')) { 9215 9216 var $coords = {}; 9217 var $zindexRelation = {}; 9218 9219 $('body .masonry.meta_overlaid .masonry-blog-item').each(function(){ 9220 $coords[$(this).index()] = $(this).css('left').substring(0, $(this).css('left').length - 2); 9221 }); 9222 9223 var $corrdsArr = $.map($coords, function (value) { return value; }); 9224 $corrdsArr = removeDuplicates($corrdsArr); 9225 $corrdsArr.sort(function(a,b){return a-b}); 9226 9227 for(var i = 0; i < $corrdsArr.length; i++){ 9228 $zindexRelation[$corrdsArr[i]] = i*10; 9229 } 9230 9231 $.each($coords,function(k,v){ 9232 9233 var $zindex; 9234 var $coordCache = v; 9235 $.each($zindexRelation,function(k,v){ 9236 if($coordCache == k) { 9237 $zindex = v; 9238 } 9239 }); 9240 9241 $('body .masonry.meta_overlaid .masonry-blog-item:eq('+k+')').css('z-index',$zindex); 9242 }); 9243 9244 } 9245 9246 } 9247 9248 function matrixToArray(matrix) { 9249 return matrix.substr(7, matrix.length - 8).split(', '); 9250 } 9251 9252 function removeDuplicates(inputArray) { 9253 var i; 9254 var len = inputArray.length; 9255 var outputArray = []; 9256 var temp = {}; 9257 9258 for (i = 0; i < len; i++) { 9259 temp[inputArray[i]] = 0; 9260 } 9261 for (i in temp) { 9262 outputArray.push(i); 9263 } 9264 return outputArray; 9265 } 9266 9267 //// filter items when filter link is clicked 9268 var clearIsoAnimation = null; 9269 var $checkForScrollBar = null; 9270 9271 9272 //number portfolios so multiple sortable ones can work easily on same page 9273 $('.portfolio-items:not(".carousel")').each(function(i){ 9274 $(this).attr('instance',i); 9275 $(this).parent().parent().find('div[class^=portfolio-filters]').attr('instance',i); 9276 }); 9277 9278 function isoClickFilter(){ 9279 var $timeout; 9280 if(window.innerWidth > 690 && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ 9281 9282 9283 /*clearInterval($checkForScrollBar); 9284 9285 if($('html').outerHeight(true) > $(window).height()) { 9286 9287 $checkForScrollBar = null; 9288 $checkForScrollBar = setInterval(function(){ 9289 9290 if($('body').height() <= $(window).height()) { 9291 fullWidthSections(); 9292 $(window).trigger('resize'); 9293 clearInterval($checkForScrollBar); 9294 } 9295 },40); 9296 } else { 9297 9298 $checkForScrollBar = null; 9299 $checkForScrollBar = setInterval(function(){ 9300 9301 if($('html').outerHeight(true) > $(window).height()) { 9302 fullWidthSections(); 9303 $(window).trigger('resize'); 9304 clearInterval($checkForScrollBar); 9305 } 9306 },40); 9307 }*/ 9308 9309 //add css animation only for sorting 9310 /* clearTimeout(clearIsoAnimation); 9311 $('.isotope, .isotope .isotope-item').css('transition-duration','0.7s'); 9312 clearIsoAnimation = setTimeout(function(){ $('.isotope, .isotope .isotope-item').css('transition-duration','0s'); },700); */ 9313 9314 clearTimeout($timeout); 9315 $timeout = setTimeout(function(){masonryZindex(); },600); 9316 9317 9318 } 9319 9320 var selector = $(this).attr('data-filter'); 9321 var $instance = $(this).parents('div[class^=portfolio-filters]').attr('instance'); 9322 9323 $.each($portfolio_containers,function(i){ 9324 if($portfolio_containers[i].attr('instance') == $instance) $portfolio_containers[i].isotope({ filter: selector }).attr('data-current-cat',selector); 9325 }); 9326 9327 9328 //active classes 9329 $(this).parent().parent().find('li a').removeClass('active'); 9330 $(this).addClass('active'); 9331 9332 //update pp 9333 if($('.portfolio-items a[rel^="prettyPhoto"]').length > 0) { 9334 setTimeout(updatePrettyPhotoGallery,170); 9335 } 9336 9337 else { 9338 setTimeout(updateMagPrettyPhotoGallery,170); 9339 } 9340 9341 return false; 9342 } 9343 9344 ////filter event 9345 $('body').on('click','.portfolio-filters ul li a, .portfolio-filters-inline ul li a', isoClickFilter); 9346 9347 9348 function updatePrettyPhotoGallery(){ 9349 $('.portfolio-items').each(function(){ 9350 9351 if($(this).find('a[rel^="prettyPhoto"]').length > 0) { 9352 9353 var $unique_id = Math.floor(Math.random()*10000); 9354 var $currentCat = $(this).attr('data-current-cat'); 9355 $(this).find('.col'+$currentCat).find('a[rel^="prettyPhoto"]').attr('rel','prettyPhoto['+$unique_id+'_sorted]'); 9356 9357 } 9358 9359 }); 9360 } 9361 9362 function updateMagPrettyPhotoGallery(){ 9363 $('.portfolio-items').each(function(){ 9364 9365 var $currentCat = $(this).attr('data-current-cat'); 9366 9367 $(this).find('.col').each(function(){ 9368 9369 $(this).find('a.gallery').removeClass('gallery').removeClass('magnific'); 9370 9371 if($(this).is($currentCat)) 9372 $(this).find('.work-info a').addClass('gallery').addClass('magnific'); 9373 9374 }); 9375 9376 9377 }); 9378 } 9379 9380 9381 9382 function masonryBlogInit() { 9383 9384 var $posts_container = $('.posts-container') 9385 9386 if($posts_container.parent().hasClass('masonry')) { 9387 9388 $posts_container.find('article').addClass('masonry-blog-item'); 9389 $posts_container.find('article').prepend('<span class="bottom-line"></span>'); 9390 9391 //move the meta to the bottom 9392 $posts_container.find('article').each(function(){ 9393 9394 var $metaClone = $(this).find('.post-meta').clone(); 9395 9396 $(this).find('.post-meta').remove(); 9397 9398 if($('#post-area.meta_overlaid').length > 0){ 9399 $(this).find('.post-header h2').after($metaClone); 9400 } else { 9401 $(this).find('.content-inner').after($metaClone); 9402 } 9403 9404 }); 9405 9406 9407 if($posts_container.parent().hasClass('masonry') && $posts_container.parent().hasClass('full-width-content')){ 9408 $posts_container.parent().wrap('<div class="full-width-content blog-fullwidth-wrap"> </div>').removeClass('full-width-content').css({'margin-left':'0','width':'auto'}); 9409 9410 //page header animation fix 9411 if( $posts_container.parents('.wpb_row').length > 0 ) $posts_container.parents('.wpb_row').css('z-index',100); 9412 9413 if($('.masonry.meta_overlaid').length == 0) { 9414 9415 if($('.masonry.classic_enhanced').length > 0) { 9416 $posts_container.parent().parents('.full-width-content').css({ 9417 'padding' : '0px 0.2% 0px 2.4%' 9418 });
9419 } else { 9420 $posts_container.parent().parents('.full-width-content').css({ 9421 'padding' : '0px 0.2% 0px 3.2%' 9422 }); 9423 } 9424 9425 } else { 9426 $posts_container.parent().parents('.full-width-content').addClass('meta-overlaid'); 9427 $('.container-wrap').addClass('meta_overlaid_blog'); 9428 } 9429 9430 fullWidthSections(); 9431 } 9432 9433 var $cols = 3; 9434 var $element = $posts_container; 9435 9436 if($posts_container.find('img').length == 0) $element = $('<img />'); 9437 9438 imagesLoaded($element,function(instance){ 9439 9440 if($('body').hasClass('mobile') || $('#post-area').hasClass('span_9')) { 9441 $cols = 2; 9442 } 9443 9444 //set img as BG if masonry classic enhanced 9445 if($posts_container.parent().hasClass('classic_enhanced')){ 9446 $posts_container.find('.large_featured.has-post-thumbnail .post-featured-img, .wide_tall.has-post-thumbnail .post-featured-img').each(function(){ 9447 var $src = $(this).find('img').attr('src'); 9448 $(this).css('background-image','url('+$src+')'); 9449 }); 9450 9451 $posts_container.find('.large_featured .nectar-flickity, .wide_tall .nectar-flickity').each(function(){ 9452 9453 $(this).find('.cell').each(function(){ 9454 var $src = $(this).find('img').attr('src'); 9455 $(this).css('background-image','url('+$src+')'); 9456 }); 9457 9458 }); 9459 } 9460 9461 $cols = blogColumnNumbCalcs(); 9462 blogHeightCalcs($posts_container, $cols); 9463 9464 if($('#post-area.meta_overlaid').length > 0) { 9465 $posts_container.isotope({ 9466 itemSelector: 'article', 9467 transitionDuration: '0s', 9468 layoutMode: 'packery', 9469 packery: { 9470 gutter: 0 9471 } 9472 }).isotope( 'layout' ); 9473 9474 9475 } else { 9476 if($posts_container.parent().hasClass('classic_enhanced')) { 9477 if($('.span_9.masonry').length == 0) { 9478 $multiplier = (window.innerWidth > 1600) ? .015 : .02; 9479 } else { 9480 $multiplier = .04; 9481 } 9482 } 9483 else { 9484 $multiplier = ($('.span_9.masonry').length == 0) ? .02: .04; 9485 } 9486 $posts_container.isotope({ 9487 itemSelector: 'article', 9488 transitionDuration: '0s', 9489 layoutMode: 'packery', 9490 packery: { 9491 gutter: $('#post-area').width()*$multiplier 9492 } 9493 }).isotope( 'layout' ); 9494 } 9495 9496 blogLoadIn(); 9497 flickityBlogInit(); 9498 9499 $(window).trigger('resize'); 9500 9501 blogMasonryZindex(); 9502 setTimeout(blogMasonryZindex,700); 9503 $window.smartresize( function(){ 9504 setTimeout(blogMasonryZindex,700); 9505 }); 9506 9507 }); 9508 9509 $(window).resize(function(){ 9510 9511 9512 //size all items in grid 9513 //sizing for large items 9514 $cols = blogColumnNumbCalcs(); 9515 blogHeightCalcs($posts_container, $cols); 9516 9517 if($('#post-area.meta_overlaid').length > 0) { 9518 9519 $posts_container.isotope({ 9520 layoutMode: 'packery', 9521 packery: { 9522 gutter: 0 9523 } 9524 }); 9525 } else { 9526 9527 if($posts_container.parent().hasClass('classic_enhanced')) { 9528 if($('.span_9.masonry').length == 0) { 9529 $multiplier = (window.innerWidth > 1600) ? .015 : .02; 9530 } else { 9531 $multiplier = .04; 9532 } 9533 } else { 9534 $multiplier = ($('.span_9.masonry').length == 0) ? .02: .04; 9535 } 9536 9537 $posts_container.isotope({ 9538 layoutMode: 'packery', 9539 packery: { 9540 gutter: $('#post-area').width()*$multiplier 9541 } 9542 }); 9543 } 9544 9545 }); 9546 9547 9548 } else { 9549 blogLoadIn(); 9550 } 9551 9552 } 9553 9554 masonryBlogInit(); 9555 9556 function blogLoadIn(){ 9557 9558 $('.posts-container').each(function(){ 9559 9560 if($(this).attr('data-load-animation') == 'none') { 9561 9562 $(this).find('.inner-wrap').removeClass('animated'); 9563 } else { 9564 9565 var $that = $(this); 9566 var waypoint = new Waypoint({ 9567 element: $that, 9568 handler: function(direction) { 9569 9570 $that.find('article').each(function(i){ 9571 $(this).delay(130*i).queue(function(next){ 9572 $(this).addClass("animated-in"); 9573 next(); 9574 });
9575 }); 9576 9577 waypoint.destroy(); 9578 }, 9579 offset: '90%' 9580 9581 }); 9582 9583 } 9584 9585 }); //each 9586 } 9587 9588 function blogHeightCalcs($posts_container, cols) { 9589 if( $posts_container.parent().hasClass('meta_overlaid') && $posts_container.find('article[class*="regular"]').length > 0) { 9590 9591 //widths 9592 $.each($posts_container,function(i,v){ 9593 var $colSize = 4; 9594 var $mult = (cols == 1) ? 1 : 2; 9595 9596 //check if higher than IE9 -- bugs out with width calc 9597 if($('html.no-csstransitions').length == 0) { 9598 $(v).find('article[class*="regular"]').css('width',Math.floor($(v).width()/cols) +'px'); 9599 $(v).find('article[class*="tall"]').css('width',Math.floor($(v).width()/cols*$mult) +'px'); 9600 } else { 9601 $('#post-area.masonry').css('width','100%'); 9602 } 9603 9604 9605 }); 9606 9607 //reset height for calcs 9608 $posts_container.find('article[class*="regular"] img').css('height','auto'); 9609 9610 var tallColHeight = Math.ceil($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote") img').first().height()); 9611 var multipler = (window.innerWidth > 470) ? 2 : 1 ; 9612 $posts_container.find('article[class*="tall"] img, .article.wide img, article.regular img').removeClass('auto-height'); 9613 $posts_container.find('article[class*="tall"] img').css('height',(tallColHeight*multipler)); 9614 $posts_container.find('article[class*="regular"] img').css('height',(tallColHeight)); 9615 //quote/links 9616 $posts_container.find('article.regular.format-link,article.regular.format-quote').each(function(){ 9617 9618 if(window.innerWidth > 470) { 9619 $(this).css({ 9620 'height': tallColHeight 9621 }); 9622 } else { 9623 $(this).css({ 9624 'height': 'auto' 9625 }); 9626 } 9627 9628 }); 9629 9630 9631 } else { 9632 $posts_container.find('article[class*="tall"] img, article.regular img').addClass('auto-height'); 9633 } 9634 9635 9636 if( $posts_container.parent().hasClass('classic_enhanced') && $posts_container.find('article[class*="regular"]').length > 0) { 9637 if($(window).width() > 690 ) 9638 classicEnhancedSizing($posts_container.find('article:not(.large_featured):not(.wide_tall)')); 9639 else 9640 classicEnhancedSizing($posts_container.find('article:not(.wide_tall)')); 9641 9642 var tallColHeight = ($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote").has-post-thumbnail').first().length > 0) ? Math.ceil($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote").has-post-thumbnail').first().css('height','auto').height()) : 600; 9643 9644 if($(window).width() > 690 ) 9645 $posts_container.find('article.large_featured, article.regular, article[class*="wide_tall"]').css('height',(tallColHeight)); 9646 else 9647 $posts_container.find('article.regular, article[class*="wide_tall"]').css('height',(tallColHeight)); 9648 9649 //for when no regular articles exist 9650 } else if( $posts_container.parent().hasClass('classic_enhanced') && $posts_container.find('article[class*="regular"]').length == 0) { 9651 var tallColHeight = ($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote").has-post-thumbnail').first().length > 0) ? Math.ceil($posts_container.find('article[class*="regular"]:not(".format-link"):not(".format-quote").has-post-thumbnail').first().css('height','auto').height()) : 600; 9652 9653 if($(window).width() > 690 ) 9654 $posts_container.find('article.large_featured, article.regular, article[class*="wide_tall"]').css('height',(tallColHeight)); 9655 else 9656 $posts_container.find('article.regular, article[class*="wide_tall"]').css('height',(tallColHeight)); 9657 } 9658 9659 //IE9 fix 9660 if($('html.no-csstransitions').length > 0) 9661 $('#post-area.masonry').css('width','100%'); 9662 9663 9664 } 9665 9666 function classicEnhancedSizing(elements) { 9667 9668 var tallestCol = 0; 9669 elements.find('.article-content-wrap').css('height','auto'); 9670 elements.filter('.has-post-thumbnail').each(function(){ 9671 ($(this).find('.article-content-wrap').outerHeight(true) > tallestCol) ? tallestCol = $(this).find('.article-content-wrap').outerHeight(true) : tallestCol = tallestCol; 9672 }); 9673 9674 elements.filter('.has-post-thumbnail').find('.article-content-wrap').css('height',(tallestCol)); 9675 9676 } 9677 9678 9679 var blogMediaQuerySize; 9680 function blogColumnNumbCalcs(){ 9681 if($('body').hasClass('mobile') && window.innerWidth < 990 || $('#post-area').hasClass('span_9') && $('#post-area.meta_overlaid').length == 0) { 9682 $cols = 2; 9683 } else if( $('#post-area').hasClass('full-width-content') || $('#post-area').parent().hasClass('full-width-content') && $('#boxed').length == 0 || $('#post-area.meta_overlaid').length > 0 ){ 9684 9685 var windowSize = $(window).width(); 9686 9687 9688 if(window.innerWidth > 1600){ 9689 blogMediaQuerySize = ($('#post-area.meta_overlaid').length > 0) ? 'four' :'five'; 9690 } else if(window.innerWidth <= 1600 && window.innerWidth >= 1300){ 9691 blogMediaQuerySize = 'four'; 9692 } else if(window.innerWidth < 1300 && window.innerWidth >= 990){ 9693 blogMediaQuerySize = ($('#post-area.meta_overlaid').length > 0) ? 'four' :'three'; 9694 } else if(window.innerWidth < 990 && window.innerWidth >= 470){ 9695 blogMediaQuerySize = 'two'; 9696 } else if(window.innerWidth < 470){ 9697 blogMediaQuerySize = ($('#post-area.meta_overlaid').length > 0) ? 'two' :'one'; 9698 } 9699 9700 9701 //boxed 9702 if($('#boxed').length > 0) { 9703 if(window.innerWidth > 1300){ 9704 blogMediaQuerySize = 'four'; 9705 } else if(window.innerWidth < 1300 && window.innerWidth > 990){ 9706 blogMediaQuerySize = ($('#post-area.meta_overlaid').length > 0) ? 'four' :'three'; 9707 } else if(window.innerWidth < 990){ 9708 blogMediaQuerySize = ($('#post-area.meta_overlaid').length > 0) ? 'two' :'one'; 9709 } 9710 9711 } 9712 9713 9714 switch (blogMediaQuerySize) { 9715 case 'five': 9716 $cols = 5; 9717 break; 9718 9719 case 'four': 9720 $cols = 4; 9721 break; 9722 9723 case 'three': 9724 $cols = 3; 9725 break; 9726 9727 case 'two': 9728 $cols = 2; 9729 break; 9730 9731 case 'one': 9732 $cols = 1; 9733 break; 9734 } 9735 9736 9737 } else { 9738 9739 $cols = 3; 9740 } 9741 9742 return $cols; 9743 9744 } 9745 9746 9747 9748 9749 9750 9751var shrinkNum = 6; 9752 9753if($('#header-outer[data-shrink-num]').length > 0 ) shrinkNum = $('#header-outer').attr('data-shrink-num'); 9754 9755headerPadding2 = headerPadding - headerPadding/1.8; 9756 9757$('body').on('click','.section-down-arrow',function(){ 9758 9759 if($(this).parents('.nectar-box-roll').length > 0) return false; 9760 9761 var $currentSection = $(this).parents('#page-header-bg'); 9762 var $topDistance = $currentSection.attr('data-height'); 9763 var $offset = ($currentSection.parents('.first-section').length == 0 || $('body[data-transparent-header="false"]').length > 0) ? $currentSection.offset().top : 0; 9764 9765 if($('body[data-permanent-transparent="1"]').length == 0) { 9766 //regular 9767 if(!$('body').hasClass('mobile')){ 9768 if($('body[data-hhun="1"]').length > 0) { 9769 $('body,html').stop().animate({ 9770 scrollTop: parseInt($topDistance) + $offset + 2 9771 },1000,'easeInOutCubic') 9772 } else { 9773 $resize = ($('#header-outer[data-header-resize="0"]').length > 0) ? 0 : parseInt(shrinkNum) + headerPadding2*2; 9774 $('body,html').stop().animate({ 9775 scrollTop: parseInt($topDistance - $('#header-space').height()) +$resize + 3 + $offset 9776 },1000,'easeInOutCubic') 9777 } 9778 9779 } else { 9780 $scrollPos = ($('#header-outer[data-mobile-fixed="1"]').length > 0) ? parseInt($topDistance) - $('#header-space').height() + parseInt($currentSection.offset().top) + 2 : parseInt($topDistance) + parseInt($currentSection.offset().top) + 2; 9781 $('body,html').stop().animate({ 9782 scrollTop: $scrollPos 9783 },1000,'easeInOutCubic') 9784 } 9785 } else { 9786 //permanent transparent 9787 $('body,html').stop().animate({ 9788 scrollTop: parseInt($topDistance) + parseInt($currentSection.offset().top) + 2 9789 },1000,'easeInOutCubic') 9790 } 9791 return false; 9792}); 9793 9794 9795 9796 9797 9798 9799 9800/*-------------------------------------------------------------------------*/ 9801/* 7. Cross Browser Fixes 9802/*-------------------------------------------------------------------------*/ 9803 9804 function crossBrowserFixes() { 9805 9806 //Fix current class in menu 9807 if ($("body").hasClass("single-portfolio") || $('body').hasClass("error404") || $('body').hasClass("search-results")) { 9808 $("li").removeClass("current_page_parent").removeClass("current-menu-ancestor").removeClass('current_page_ancestor'); 9809 } 9810 9811 9812 //fix for IE8 nth-child 9813 $('.recent_projects_widget div a:nth-child(3n+3), #sidebar #flickr div:nth-child(3n+3) a, #footer-outer #flickr div:nth-child(3n+3) a').css('margin-right','0px'); 9814 9815 //remove br's from code tag 9816 $('code').find('br').remove(); 9817 9818 //if a clear is the last div, remove the padding 9819 if($('.container.main-content > .row > div:last-child').hasClass('clear')) { 9820 $('.container.main-content > .row > div:last-child').css('padding-bottom','0'); 9821 } 9822 9823 //homepage recent blog for IE8 9824 $('.container-wrap .blog-recent > div:last-child').addClass('col_last'); 9825 9826 //blog ascend bottom padding 9827 if($('.single .blog_next_prev_buttons').length > 0) $('.container-wrap').css('padding-bottom',0); 9828 9829 //contact form 9830 $('.wpcf7-form p:has(input[type=submit])').css('padding-bottom','0px'); 9831 9832 $('.full-width-content .wpcf7-submit').on('click',function(){ setTimeout(function(){ fullWidthContentColumns() },1000); setTimeout(function(){ fullWidthContentColumns() },2000); }); 9833 9834 //no caption home slider fix 9835 $('#featured article').each(function(){ 9836 if($(this).find('h2').attr('data-has-caption') == '0') { 9837 $(this).parents('.slide').addClass('no-caption'); 9838 } 9839 }); 9840 9841 //gravity form inside fw content row 9842 $('.gform_body').click(function(){ 9843 setTimeout(function(){ fullWidthContentColumns(); },200);
9844 }); 9845 9846 //chat post format nth child color 9847 $('article.post.format-chat .content-inner dt:odd').css('color','#333'); 9848 9849 //remove margin on last cols inside of full width sections 9850 $('.full-width-section').each(function(){ 9851 $(this).find('> .span_12 > div.col_last').last().css('margin-bottom','0'); 9852 }); 9853 9854 //remove p tags from extra content editor when warpping only an img 9855 $('#portfolio-extra p').each(function(){ 9856 if($(this).find('*').length == 1 && $(this).find('img').length == 1) { 9857 $(this).find('img').unwrap(); 9858 } 9859 }); 9860 9861 9862 //vc text_separator color 9863 $('.vc_text_separator').each(function(){ 9864 if( $(this).parents('.full-width-section').length > 0 ) $(this).find('div').css('background-color',$(this).parents('.full-width-section').find('.row-bg').css('background-color')); 9865 }); 9866 9867 //carousel head button alignment 9868 $('.carousel-heading').each(function(){ 9869 if($(this).find('h2').length > 0) $(this).find('.carousel-prev, .carousel-next').css('top','7px'); 9870 }); 9871 9872 //remove carousel heading if not being used 9873 $('.carousel-wrap').each(function(){ 9874 if($(this).find('.carousel-heading .container:empty').length > 0) $(this).find('.carousel-heading').remove(); 9875 }); 9876 9877 //woocommerce product thuimbnails 9878 $('.woocommerce div.product div.images div.thumbnails a:nth-child(4n+4)').css('margin-right','0px'); 9879 9880 //remove extra galleries when using the nectar gallery slider on projects and posts 9881 $('article.post .gallery-slider .gallery, article.post .gallery-slider .jetpack-slideshow, .single-portfolio .gallery-slider .gallery, .single-portfolio .gallery-slider .jetpack-slideshow').remove(); 9882 9883 9884 $('.woocommerce .span_9 .products.related .products li:nth-child(4), .woocommerce .span_9 .products.upsells .products li:nth-child(4)').remove(); 9885 $('.woocommerce .span_9 .products.related .products li:nth-child(3), .woocommerce .span_9 .products.upsells .products li:nth-child(3)').css('margin-right','0'); 9886 9887 $('.cart-menu a, .widget_shopping_cart a').addClass('no-ajaxy'); 9888 9889 //clients no hover if no link 9890 $('div.clients').each(function(){ 9891 $(this).find('> div').each(function(){ 9892 if($(this).find('a').length == 0) { 9893 $(this).addClass('no-link'); 9894 } 9895 }); 9896 }); 9897 9898 //remove ajaxy from single posts when using disqus 9899 if(nectarLove.disqusComments == 'true') $('#post-area article a, .blog_next_prev_buttons a, #portfolio-nav #prev-link a, #portfolio-nav #next-link a, .portfolio-items .col .work-item .work-info a').addClass('no-ajaxy'); 9900 9901 //blog next color bg only 9902 if($('.blog_next_prev_buttons').find('.bg-color-only-indicator').length > 0) $('.blog_next_prev_buttons').addClass('bg-color-only').find('.bg-color-only-indicator').remove(); 9903 9904 if($('#single-below-header').hasClass('fullscreen-header') && $('.blog_next_prev_buttons').length == 0 ) $('#author-bio, .comment-wrap').addClass('lighter-grey'); 9905 9906 //shop header parallax margin 9907 if($('body.woocommerce').find('#page-header-bg').length > 0){ 9908 $('.container-wrap').css({'margin-top':'0px','padding-top':'30px'}); 9909 } 9910 9911 //remove arrows on mega menu item 9912 $('header#top nav .megamenu .sub-menu a.sf-with-ul .sf-sub-indicator').remove(); 9913 9914 //if using wooCommerce sitewide notice 9915 if($('.demo_store').length > 0) $('#header-outer, #header-space').css('margin-top','32px'); 9916 9917 //footer last column class for IE8 9918 $('#footer-widgets .container .row > div:last-child').addClass('col_last'); 9919 9920 //nectar slider external links 9921 $('.swiper-slide.external-button-1 .buttons > div:nth-child(1) a').attr('target','_blank'); 9922 $('.swiper-slide.external-button-2 .buttons > div:nth-child(2) a').attr('target','_blank'); 9923 9924 //portfolio external links 9925 $(".portfolio-items a[href*='http://']:not([href*='"+window.location.hostname+"']), .recent_projects_widget a[href*='http://']:not([href*='"+window.location.hostname+"'])").attr("target","_blank"); 9926 9927 //remove excess inner content when empty row 9928 $('.container-wrap .row > .wpb_row').each(function(){ 9929 if($(this).find('> .span_12 > .wpb_column > .wpb_wrapper').length > 0 && $(this).find('> .span_12 > .wpb_column > .wpb_wrapper').find('*').length == 0) $(this).find('> .span_12 ').remove(); 9930 }); 9931 9932 //remove boxed style from full width content 9933 $('.full-width-content .col.boxed').removeClass('boxed'); 9934 9935 //remove full width attribute on slider in full width content section 9936 $('.full-width-content .wpb_column .nectar-slider-wrap[data-full-width="true"]').attr('data-full-width','false'); 9937 9938 if( $('.nectar-slider-wrap.first-section').length == 0 && 9939 $('.full-width-section.first-section > .span_12 > .vc_span12 > .wpb_wrapper > .nectar-slider-wrap').length == 0 && 9940 $('.parallax_slider_outer.first-section').length == 0 && 9941 $('.full-width-content.first-section .wpb_wrapper > .nectar-slider-wrap').length == 0 && 9942 !($('.wpb_row.first-section > .nectar-parallax-scene').length == 1 && $('#header-outer[data-transparent-header="true"]').length == 1) ) { 9943 $('#header-outer .ns-loading-cover').remove(); 9944 } 9945 9946 //portfolio description remove on hover 9947 var $tmpTitle = null; 9948 $('.portfolio-items > .col a[title]').hover(function(){ 9949 $tmpTitle = $(this).attr('title'); 9950 $(this).attr('title',' '); 9951 },function(){ 9952 $(this).attr('title', $tmpTitle); 9953 }); 9954 $('.portfolio-items > .col a[title]').click(function(){ 9955 $(this).attr('title', $tmpTitle); 9956 }); 9957 9958 }; 9959 9960 crossBrowserFixes(); 9961 9962 9963 9964 9965 function wooPriceSlider(){ 9966 9967 9968 // woocommerce_price_slider_params is required to continue, ensure the object exists 9969 if ( typeof woocommerce_price_slider_params === 'undefined' || !$('body').hasClass('woocommerce') ) { 9970 return false; 9971 } 9972 9973 // Get markup ready for slider 9974 $( 'input#min_price, input#max_price' ).hide(); 9975 $( '.price_slider, .price_label' ).show(); 9976 9977 // Price slider uses jquery ui 9978 var min_price = $( '.price_slider_amount #min_price' ).data( 'min' ), 9979 max_price = $( '.price_slider_amount #max_price' ).data( 'max' ); 9980 9981 current_min_price = parseInt( min_price, 10 ); 9982 current_max_price = parseInt( max_price, 10 ); 9983 9984 if ( woocommerce_price_slider_params.min_price ) current_min_price = parseInt( w
9984oocommerce_price_slider_params.min_price, 10 ); 9985 if ( woocommerce_price_slider_params.max_price ) current_max_price = parseInt( woocommerce_price_slider_params.max_price, 10 ); 9986 9987 $( 'body' ).bind( 'price_slider_create price_slider_slide', function( event, min, max ) { 9988 if ( woocommerce_price_slider_params.currency_pos === 'left' ) { 9989 9990 $( '.price_slider_amount span.from' ).html( woocommerce_price_slider_params.currency_symbol + min ); 9991 $( '.price_slider_amount span.to' ).html( woocommerce_price_slider_params.currency_symbol + max ); 9992 9993 } else if ( woocommerce_price_slider_params.currency_pos === 'left_space' ) { 9994 9995 $( '.price_slider_amount span.from' ).html( woocommerce_price_slider_params.currency_symbol + " " + min ); 9996 $( '.price_slider_amount span.to' ).html( woocommerce_price_slider_params.currency_symbol + " " + max ); 9997 9998 } else if ( woocommerce_price_slider_params.currency_pos === 'right' ) { 9999 10000 $( '.price_slider_amount span.from' ).html( min + woocommerce_price_slider_params.currency_symbol ); 10001 $( '.price_slider_amount span.to' ).html( max + woocommerce_price_slider_params.currency_symbol ); 10002 10003 } else if ( woocommerce_price_slider_params.currency_pos === 'right_space' ) { 10004 10005 $( '.price_slider_amount span.from' ).html( min + " " + woocommerce_price_slider_params.currency_symbol ); 10006 $( '.price_slider_amount span.to' ).html( max + " " + woocommerce_price_slider_params.currency_symbol ); 10007 10008 } 10009 10010 $( 'body' ).trigger( 'price_slider_updated', min, max ); 10011 }); 10012 10013 $( '.price_slider' ).slider({ 10014 range: true, 10015 animate: true, 10016 min: min_price, 10017 max: max_price, 10018 values: [ current_min_price, current_max_price ], 10019 create : function( event, ui ) { 10020 10021 $( '.price_slider_amount #min_price' ).val( current_min_price ); 10022 $( '.price_slider_amount #max_price' ).val( current_max_price ); 10023 10024 $( 'body' ).trigger( 'price_slider_create', [ current_min_price, current_max_price ] ); 10025 }, 10026 slide: function( event, ui ) { 10027 10028 $( 'input#min_price' ).val( ui.values[0] ); 10029 $( 'input#max_price' ).val( ui.values[1] ); 10030 10031 $( 'body' ).trigger( 'price_slider_slide', [ ui.values[0], ui.values[1] ] ); 10032 }, 10033 change: function( event, ui ) { 10034 10035 $( 'body' ).trigger( 'price_slider_change', [ ui.values[0], ui.values[1] ] ); 10036 10037 }, 10038 }); 10039 10040 } 10041 10042 10043//vc col mobile fixes 10044function vcMobileColumns() { 10045 $('.wpb_row').each(function(){ 10046 if(typeof $(this).find('.span_12').offset() != 'undefined' ) { 10047 10048 $(this).find('[class*="vc_col-"]').each(function(){ 10049 10050 var $firstChildOffset = $(this).parents('.span_12').offset().left; 10051 10052 $(this).removeClass('no-left-margin'); 10053 if($(this).offset().left < $firstChildOffset + 27) { 10054 $(this).addClass('no-left-margin'); 10055 } else { 10056 $(this).removeClass('no-left-margin'); 10057 } 10058 }); 10059 } 10060 }); 10061} 10062 10063if($('[class*="vc_col-xs-"], [class*="vc_col-md-"], [class*="vc_col-lg-"]').length > 0) vcMobileColumns(); 10064 10065 10066/*-------------------------------------------------------------------------*/ 10067/* 8. Form Styling 10068/*-------------------------------------------------------------------------*/ 10069 10070if($('body[data-form-style="minimal"]').length > 0) { 10071 10072 //turn user set place holders into labels for effect 10073 function convertPlaceholders() { 10074 $('form input[placeholder], form textarea[placeholder]').each(function(i){ 10075 if($(this).attr('placeholder').length > 1) { 10076 var $placeholder = $(this).attr('placeholder'); 10077 var $inputID = ($(this).is('[id]')) ? $(this).attr('id') : 'id-'+i; 10078 //add placeholder as label if label doesn't already exist 10079 10080 //skip cf7 //|| $(this).prev('label').length == 1 && $placeholder.length > $(this).prev('label').text().length 10081 if($(this).parents('.wpcf7-form-control-wrap').length == 0) { 10082 if($(this).prev('label').length == 0 || $(this).is('textarea')) { 10083 $('<label for="'+$inputID+'">'+$placeholder+'</label>').insertBefore($(this)); 10084 } 10085 } else { 10086 if($(this).parents('.wpcf7-form-control-wrap').find('label').length == 0) { 10087 $('<label for="'+$inputID+'">'+$placeholder+'</label>').insertBefore($(this).parents('.wpcf7-form-control-wrap ')); 10088 } 10089 } 10090 $(this).removeAttr('placeholder'); 10091 } 10092 }); 10093 } 10094 convertPlaceholders(); 10095 setTimeout(convertPlaceholders,500); 10096 10097 //woocommerce placeholder fix 10098 $( '#billing_country, #shipping_country, .country_to_state' ).on('change',function(){ 10099 convertPlaceholders(); 10100 removeExcessLabels(); 10101 var $wooDynamicPlaceholders = setInterval(function(){
10102 convertPlaceholders(); 10103 convertToMinimalStyle('form label'); 10104 removeExcessLabels(); 10105 },30); 10106 setTimeout(function(){ clearInterval($wooDynamicPlaceholders); },600); 10107 10108 }); 10109 10110 function convertToMinimalStyle(selector){ 10111 10112 $(selector).each(function(){ 10113 if($(this).parent().find('input:not([type="checkbox"]):not([type="hidden"]):not(#search-outer input):not(.adminbar-input):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="date"]):not([type="color"]):not([type="range"]):not([role="button"]):not([role="combobox"]):not(.select2-focusser)').length == 1 || $(this).parent().find('textarea').length == 1) { 10114 10115 if($(this).parents('.minimal-form-input').length == 0) { 10116 10117 //if there's a direct input next to label 10118 10119 if($(this).next('input').length == 1) { 10120 10121 $(this).next('input').andSelf().wrapAll('<div class="minimal-form-input"/>'); 10122 } else { 10123 //if we need to traverse to parent instead 10124 $(this).parent().wrapInner('<div class="minimal-form-input" />'); 10125 } 10126 $html = $(this).html(); 10127 $(this)[0].innerHTML = '<span class="text"><span class="text-inner">'+$html+'</span></span>'; 10128 10129 if($(this).parent().find('textarea').length == 1) $(this).parents('.minimal-form-input').addClass('textarea'); 10130 } 10131 } 10132 10133 }); 10134 10135 //for labels that changed that already have minimal form markup - just need to update content 10136 $(selector).each(function(){ 10137 if($(this).parents('.minimal-form-input').length == 1 && $(this).find('.text').length == 0) { 10138 10139 $html = $(this).html(); 10140 $(this)[0].innerHTML = '<span class="text"><span class="text-inner">'+$html+'</span></span>'; 10141 10142 } 10143 10144 }); 10145 } 10146 10147 convertToMinimalStyle('form label'); 10148 10149 setTimeout(function(){ convertToMinimalStyle('form label'); removeExcessLabels(); checkValueOnLoad(); },501); 10150 10151 //remove excess labels 10152 function removeExcessLabels() { 10153 $('.minimal-form-input').each(function(){ 10154 if($(this).find('label').length > 1) { 10155 $lngth = 0; 10156 $(this).find('label').each(function(){ 10157 if($(this).text().length >= $lngth) { 10158 $lngth = $(this).text().length; 10159 $(this).parents('.minimal-form-input').find('label').addClass('tbr'); 10160 $(this).removeClass('tbr'); 10161 } 10162 }); 10163 $(this).find('label.tbr').remove(); 10164 } 10165 }); 10166 } 10167 removeExcessLabels(); 10168 10169 10170 //add labels to inputs that don't have them 10171 $('input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not(#search-outer input):not([type="hidden"]):not([type="button"]):not([type="date"]):not([type="color"]):not([type="number"]):not([type="range"]):not([role="button"]):not([role="combobox"]):not(.select2-focusser), textarea').each(function(){ 10172 if($(this).parents('.minimal-form-input').length == 0) { 10173 10174 $('<label></label>').insertBefore($(this)); 10175 convertToMinimalStyle($(this).prev('label')); 10176 } 10177 }); 10178 10179 10180 $('body').on('focus','.minimal-form-input input, .minimal-form-input textarea',function(){ 10181 $(this).parents('.minimal-form-input').addClass('filled').removeClass('no-text'); 10182 }); 10183 $('body').on('blur','.minimal-form-input input, .minimal-form-input textarea',function(){ 10184 if($(this).val().length > 0) $(this).parents('.minimal-form-input').addClass('has-text').removeClass('no-text'); 10185 else $(this).parents('.minimal-form-input').removeClass('has-text').addClass('no-text'); 10186 $(this).parents('.minimal-form-input').removeClass('filled'); 10187 }); 10188 10189 10190 //on load 10191 function checkValueOnLoad() { 10192 $('.minimal-form-input input, .minimal-form-input textarea').each(function(){ 10193 if($(this).val().length > 0) $(this).parents('.minimal-form-input').addClass('has-text').removeClass('no-text'); 10194 }); 10195 } 10196 checkValueOnLoad(); 10197 10198 // Textarea Auto Resize 10199 var hiddenDiv = $('.hiddendiv').first(); 10200 if (!hiddenDiv.length) { 10201 hiddenDiv = $('<div class="textareahiddendiv common"></div>'); 10202 $('body').append(hiddenDiv); 10203 } 10204 var text_area_selector = 'textarea'; 10205 10206 function textareaAutoResize($textarea) { 10207 // Set font properties of hiddenDiv 10208 10209 var fontFamily = $textarea.css('font-family'); 10210 var fontSize = $textarea.css('font-size'); 10211 10212 if (fontSize) { hiddenDiv.css('font-size', fontSize); } 10213 if (fontFamily) { hiddenDiv.css('font-family', fontFamily); } 10214 10215 if ($textarea.attr('wrap') === "off") { 10216 hiddenDiv.css('overflow-wrap', "normal") 10217 .css('white-space', "pre"); 10218 } 10219 10220 10221 10222 10223 hiddenDiv.text($textarea.val() + '\n'); 10224 var content = hiddenDiv.html().replace(/\n/g, '<br>'); 10225 hiddenDiv.html(content); 10226 10227 10228 // When textarea is hidden, width goes crazy. 10229 // Approximate with half of window size 10230 10231 if ($textarea.is(':visible')) { 10232 hiddenDiv.css('width', $textarea.width()); 10233 } 10234 else { 10235 hiddenDiv.css('width', $(window).width()/2); 10236 } 10237 10238 $textarea.css('height', hiddenDiv.height()); 10239 } 10240 10241 $(text_area_selector).each(function () { 10242 var $textarea = $(this); 10243 if ($textarea.val().length) { 10244 textareaAutoResize($textarea); 10245 } 10246 });
10247 10248 $('body').on('keyup keydown autoresize', text_area_selector, function () { 10249 textareaAutoResize($(this)); 10250 }); 10251 10252} 10253 10254 10255if($('body[data-fancy-form-rcs="1"]').length > 0) { 10256 10257 //radio / checkbox markup conversion 10258 10259 ////default 10260 $('input[type="checkbox"]').each(function(){ 10261 //check if for relationship exists 10262 $id = $(this).attr('id'); 10263 if(typeof $id !== typeof undefined && $id !== false && $('label[for="'+$id+'"]').length > 0) { 10264 $('label[for="'+$id+'"]').prepend('<span></span>'); 10265 } 10266 10267 }); 10268 10269 ////for cf7 10270 $('.wpcf7-radio .wpcf7-list-item-label').each(function(i){ 10271 var $data = $(this).html(); 10272 var $name = $(this).parent().find('input').attr('name') + i; 10273 $(this).parent().find('input').attr('id',$name); 10274 $(this).replaceWith('<label for="'+$name+'">'+$data+'</label>'); 10275 }); 10276 10277 $('.wpcf7-checkbox .wpcf7-list-item-label').each(function(){ 10278 var $data = $(this).html(); 10279 var $name = $(this).parent().find('input').attr('value'); 10280 $(this).parent().find('input').attr('id',$name); 10281 $(this).replaceWith('<label for="'+$name+'"><span></span>'+$data+'</label>'); 10282 }); 10283 10284 10285 //select 10286 $('select:not(.comment-form-rating #rating)').each(function(){ 10287 10288 //cf7 10289 if($(this).parents('.wpcf7-form-control-wrap').length > 0) { 10290 10291 //select 2 already initialized 10292 if($(this).parents('.wpcf7-form-control-wrap').find('.select2-container').length > 0) { 10293 $selector = $($(this).prev('.select2-container')); 10294 } else { 10295 $selector = $(this); 10296 } 10297 10298 //if label is found 10299 if($selector.parents('.wpcf7-form-control-wrap').parent().find('label').length == 1) { 10300 $selector.parents('.wpcf7-form-control-wrap').parent().wrapInner('<div class="fancy-select-wrap" />'); 10301 } else { 10302 //default wrap 10303 $selector.wrap('<div class="fancy-select-wrap" />'); 10304 } 10305 } 10306 //default 10307 else { 10308 10309 //select 2 already initialized 10310 if($(this).prev('.select2-container').length > 0) { 10311 $selector = $(this).prev('.select2-container'); 10312 } else { 10313 $selector = $(this); 10314 } 10315 10316 //if label is found 10317 if($selector.prev('label').length == 1) { 10318 $selector.prev('label').andSelf().wrapAll('<div class="fancy-select-wrap" />'); 10319 } else if($selector.next('label').length == 1) { 10320 $selector.next('label').andSelf().wrapAll('<div class="fancy-select-wrap" />'); 10321 } else { 10322 //default wrap 10323 $selector.wrap('<div class="fancy-select-wrap" />'); 10324 } 10325 } 10326 }); 10327 10328 function select2Init(){ 10329 $('select:not(.state_select):not(.country_select):not(.comment-form-rating #rating)' ).each( function() { 10330 $( this ).select2({ 10331 minimumResultsForSearch: 7 10332 }); 10333 }); 10334 } 10335 10336 select2Init(); 10337 10338} 10339 10340 $('a#toggle-section').click(function(){ 10341 10342 //open 10343 if(!$('#style-selection').hasClass('open')){ 10344 var $distance = ($('body[data-smooth-scrolling="0"]').length > 0) ? '0px' : '13px'; 10345 $('#style-selection').addClass('open'); 10346 $('#style-selection').stop().animate({ 10347 'right' : $distance 10348 },600,'easeOutCubic'); 10349 } 10350 10351 //close 10352 else { 10353 var $distance = ($('body[data-smooth-scrolling="0"]').length > 0) ? '-196px' : '-177px'; 10354 $('#style-selection').removeClass('open'); 10355 $('#style-selection').stop().animate({ 10356 'right' : $distance 10357 },500,'easeInCubic'); 10358 if($('#style-selection .select2-choice').length > 0) { 10359 $('#style-selection .select2-container').removeClass('select2-container-active').removeClass('select2-dropdown-open'); 10360 $('.select2-drop, .select2-drop-mask').hide(); 10361 } 10362 } 10363 10364 return false; 10365 }); 10366 10367 10368 10369 10370 10371 if($('body[data-ajax-transitions="true"]').length > 0 && $('#ajax-loading-screen[data-method="ajax"]').length > 0 && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) && $(window).width() > 690 ) { 10372 10373 $('#ajax-content-wrap').ajaxify({ 10374 'selector':'#ajax-content-wrap a:not(.no-ajaxy):not([target="_blank"]):not([href^="#"]):not(.comment-edit-link):not(#cancel-comment-reply-link):not(.comment-reply-link):not(#toggle-nav):not(.cart_list a):not(.logged-in-as a):not(.no-widget-added a):not(.add_to_cart_button):not(.product-wrap a):not(.section-down-arrow):not([data-filter]):not(.product_list_widget a):not(.pp):not
10374([rel^="prettyPhoto"]):not(.pretty_photo), #header-outer li:not(.no-ajaxy) > a:not(.no-ajaxy), #header-outer #logo', 10375 'verbosity': 0, 10376 requestDelay: 400, 10377 previewoff : true, 10378 memoryoff: true, 10379 turbo : false 10380 }); 10381 10382 $(window).on("pronto.render", initPage) 10383 .on("pronto.load", destroyPage) 10384 .on("pronto.request", transitionPage); 10385 10386 initPage(); 10387 10388 } else if($('body[data-ajax-transitions="true"]').length > 0 && $('#ajax-loading-screen[data-method="standard"]').length > 0 ) { 10389 10390 //chrome white BG flash fix 10391 $('html').addClass('page-trans-loaded'); 10392 10393 //fadeout loading animation 10394 if($('#ajax-loading-screen[data-effect="standard"]').length > 0) { 10395 if($('.nectar-particles').length == 0) setTimeout(function(){ $('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){ $(this).css({'display':'none'}); }); $('#ajax-loading-screen .loading-icon').transition({'opacity':0},800) },100); 10396 10397 //safari back/prev fix 10398 if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 || navigator.userAgent.match(/(iPod|iPhone|iPad)/)){ 10399 window.onunload = function(){ $('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){ $(this).css({'display':'none'}); }); $('#ajax-loading-screen .loading-icon').transition({'opacity':0},600) }; 10400 window.onpageshow = function(event) { 10401 if (event.persisted) { 10402 $('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){ 10403 $(this).css({'display':'none'}); 10404 }); 10405 $('#ajax-loading-screen .loading-icon').transition({'opacity':0},600); 10406 } 10407 } 10408 } else if(navigator.userAgent.indexOf('Firefox') != -1) { 10409 window.onunload = function(){}; 10410 } 10411 10412 10413 10414 10415 } else { 10416 if($('#page-header-wrap #page-header-bg[data-animate-in-effect="zoom-out"] .nectar-video-wrap').length == 0 && $('.parallax_slider_outer').length == 0 && $('.first-nectar-slider').length == 0) { 10417 setTimeout(function(){ 10418 $('#ajax-loading-screen').addClass('loaded'); 10419 setTimeout(function(){ $('#ajax-loading-screen').addClass('hidden'); },1000); 10420 },150); 10421 } 10422 10423 //safari back/prev fix 10424 if(navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 || navigator.userAgent.match(/(iPod|iPhone|iPad)/)){ 10425 window.onunload = function(){ $('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){ $(this).css({'display':'none'}); }); $('#ajax-loading-screen .loading-icon').transition({'opacity':0},600) }; 10426 window.onpageshow = function(event) { 10427 if (event.persisted) { 10428 $('#ajax-loading-screen').stop().transition({'opacity':0},800,function(){ 10429 $(this).css({'display':'none'}); 10430 }); 10431 $('#ajax-loading-screen .loading-icon').transition({'opacity':0},600); 10432 } 10433 } 10434 } else if(navigator.userAgent.indexOf('Firefox') != -1) { 10435 window.onunload = function(){}; 10436 } 10437 } 10438 10439 //remove excess loading images now 10440 $('.portfolio-loading, .nectar-slider-loading .loading-icon').remove(); 10441 10442 10443 if($('#ajax-loading-screen[data-disable-fade-on-click="1"]').length == 0) { 10444 $('a[href]:not(.no-ajaxy):not([target="_blank"]):not([href^="#"]):not([href^="mailto:"]):not(.comment-edit-link):not(.magnific-popup):not(.magnific):not(.meta-comment-count a):not(.comments-link):not(#cancel-comment-reply-link):not(.comment-reply-link):not(#toggle-nav):not(.logged-in-as a):not(.add_to_cart_button):not(.section-down-arrow):not([data-filter]):not(.pp):not([rel^="prettyPhoto"]):not(.pretty_photo)').click(function(e){ 10445 10446 10447 if($(this).parent('.menu-item-has-children').length > 0 && $(this).parents('.off-canvas-menu-container').length > 0) { 10448 10449 } else { 10450 if(!$(this).parent().hasClass('no-ajaxy')) { 10451 10452 var $targetLocation = $(this).attr('href'); 10453 var $timeOutDur = 0; 10454 if($targetLocation != '') { 10455 10456 $('#ajax-loading-screen').addClass('set-to-fade'); 10457 10458 transitionPageStandard(); 10459 10460 setTimeout(function(){ 10461 window.location = $targetLocation; 10462 },$timeOutDur) 10463 10464 return false; 10465 } 10466 } 10467 } 10468 10469 }); 10470 } // if disable fade out is not on 10471 } 10472 10473 10474 function transitionPage(e) { 10475 10476 10477 if($(window).scrollTop() > 0) { 10478 10479 //stop nicescroll 10480 if($().niceScroll && $("html").getNiceScroll()){ 10481 var nice = $("html").getNiceScroll(); 10482 nice.stop(); 10483 } 10484 10485 $('body,html').stop(true,true).animate({ 10486 scrollTop:0 10487 },500,'easeOutQuad',function(){ 10488 $('#ajax-loading-screen').css({'opacity':'1', 'display':'none'}); 10489 $('#ajax-loading-screen').stop(true,true).fadeIn(600,function(){ 10490 $('#ajax-loading-screen .loading-icon').animate({'opacity':1},400); 10491 //close widget area 10492 setTimeout(function(){ if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click'); },400); 10493 }); 10494 }); 10495 10496 } else { 10497 $('#ajax-loading-screen').css('opacity','1').stop().fadeIn(600,function(){ 10498 $('#ajax-loading-screen .loading-icon').animate({'opacity':1},400); 10499 }); 10500 10501 //close widget area 10502 setTimeout(function(){ if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click'); },400); 10503 } 10504 10505 10506 } 10507 10508 function transitionPageStandard(e) { 10509 10510 $('#ajax-loading-screen').css('opacity','1').stop().fadeIn(500); 10511 //setTimeout(function(){ $('#ajax-loading-screen .loading-icon').animate({'opacity':1},500); },400); 10512 10513 } 10514 10515 function destroyPage(e) { 10516 $(window).off('scroll.appear'); 10517 } 10518 10519 function initPage(e) { 10520 10521 if(!$('body').hasClass('ajax-loaded')) return false; 10522 10523 10524 //init js 10525 lightBoxInit(); 10526 addOrRemoveSF(); 10527 $(".sf-menu").superfish('destroy'); 10528 $('#header-outer').removeClass('dark-slide'); 10529 initSF(); 10530 SFArrows(); 10531 headerInit(); 10532 var $effectTimeout = ($('#ajax-loading-screen').length > 0) ? 800 : 0; 10533 pageHeaderTextEffectInit(); 10534 if($('#page-header-bg .nectar-video-wrap video').length == 0) setTimeout(pageHeaderTextEffect,$effectTimeout); 10535 videoSlidePos(); 10536 controlsInit(); 10537 coloredButtons(); 10538 columnBGColors();
10539 fwCarouselLinkFix(); 10540 if($('.carousel').length > 0) { 10541 standardCarouselInit(); 10542 clientsCarouselInit(); 10543 carouselHeightCalcs(); 10544 } 10545 if($('.products-carousel').length > 0) productCarouselInit(); 10546 flexsliderInit(); 10547 progressBars(); 10548 milestoneInit(); 10549 accordionInit(); 10550 tabbedInit(); 10551 tabbbedDeepLinking(); 10552 accordionDeepLinking(); 10553 ulChecks(); 10554 oneFourthClasses(); 10555 carouselfGrabbingClass(); 10556 clientsFadeIn(); 10557 fullWidthSections(); 10558 fwsClasses(); 10559 fullwidthImgOnlySizingInit(); 10560 fullwidthImgOnlySizing(); 10561 fullWidthRowPaddingAdjustInit(); 10562 fullWidthRowPaddingAdjustCalc(); 10563 boxRollInit(); 10564 setTimeout(function(){ 10565 colAndImgAnimations(); 10566 },100); 10567 if($('body[data-animated-anchors="true"]').length > 0) setTimeout(scrollSpyInit,200); 10568 nectar_fancy_ul_init(); 10569 socialSharingInit(); 10570 pricingTableHeight(); 10571 createTestimonialControls(); 10572 testimonialSliderHeight(); 10573 largeIconHover(); 10574 fullscreenMenuInit(); 10575 boxRollMouseWheelInit(); 10576 midnightInit(); 10577 setTimeout(morphingOutlines,100); 10578 responsiveVideoIframesInit(); 10579 responsiveVideoIframes(); 10580 fullWidthContentColumns(); 10581 videoBGInit(); 10582 $window.unbind('scroll.parallaxSections').unbind('resize.parallaxSections'); 10583 parallaxScrollInit(); 10584 masonryBlogInit(); 10585 masonryPortfolioInit(); 10586 portfolioAccentColor(); 10587 portfolioHoverEffects(); 10588 portfolioFiltersInit(); 10589 style6Img(); 10590 isotopeCatSelection(); 10591 $(window).unbind('.infscr'); 10592 infiniteScrollInit(); 10593 toTopBind(); 10594 centerLove(); 10595 postNextButtonEffect(); 10596 if($('.nectar-box-roll').length == 0) headerRowColorInheritInit(); 10597 pageLoadHash(); 10598 slideOutWidgetAreaScrolling(); 10599 10600 //cf7 10601 if($().wpcf7InitForm) $('div.wpcf7 > form').wpcf7InitForm(); 10602 10603 //woocommerce price slider 10604 wooPriceSlider(); 10605 10606 //twitter widget 10607 if(typeof twttr != 'undefined') { twttr.widgets.load(); } 10608 10609 //Calendarize.it 10610 if(typeof init_rhc === 'function') { init_rhc(); } 10611 10612 //unwrap post and protfolio videos 10613 $('.video-wrap iframe').unwrap(); 10614 $('#sidebar iframe[src]').unwrap(); 10615 10616 $('video:not(.slider-video)').attr('width','100%'); 10617 $('video:not(.slider-video)').attr('height','100%'); 10618 10619 $('.wp-video-shortcode.mejs-container').each(function(){ 10620 $(this).attr('data-aspectRatio', parseInt($(this).css('height')) / parseInt($(this).css('width'))); 10621 }); 10622 10623 //mediaElement 10624 $('video.wp-media-shortcode-ajax, audio.wp-media-shortcode-ajax').each(function(){ 10625 if(!$(this).parent().hasClass('mejs-mediaelement') && $().mediaelementplayer) { 10626 $(this).mediaelementplayer(); 10627 } 10628 }); 10629 10630 $('.mejs-container').css({'height': '100%', 'width': '100%'}); 10631 10632 $('audio').attr('width','100%'); 10633 $('audio').attr('height','100%'); 10634 10635 $('audio').css('visibility','visible'); 10636 10637 if($('body').hasClass('mobile')){ 10638 $('video').css('visibility','hidden'); 10639 } else { 10640 $('video').css('visibility','visible'); 10641 } 10642 10643 $('.wpb_row:has(".nectar-video-wrap")').each(function(i){ 10644 $(this).css('z-index',100 + i); 10645 }); 10646 10647 showLateIframes(); 10648 10649 mouseParallaxInit(); 10650 10651 //chrome self hosted slider bg video correct 10652 if(navigator.userAgent.indexOf('Chrome') > 0) { 10653 $('.swiper-wrapper .video-wrap').each(function(i){ 10654 var webmSource = jQuery(this).find('video source[type="video/webm"]').attr('src') + "?id="+Math.ceil(Math.random()*10000); 10655 var firstVideo = jQuery(this).find('video').get(0); 10656 firstVideo.src = webmSource; 10657 firstVideo.load(); 10658 }); 10659 } 10660 10661 10662 if($('.nectar-video-bg').length > 0) { 10663 setTimeout(function(){ 10664 resizeVideoToCover(); 10665 $('.video-color-overlay').each(function(){ 10666 $(this).css('background-color',$(this).attr('data-color')); 10667 }); 10668 $('.nectar-video-wrap').transition({'opacity':'1'},0); 10669 $('.video-color-overlay').transition({'opacity':'0.7'},0); 10670 10671 },400); 10672 } 10673 10674 10675 nectarPageHeader(); 10676 10677 10678 if( $('#featured').length > 0){ 10679 10680 customSliderHeight(); 10681 homeSliderInit2(); 10682 $(window).off('scroll.hsps'); 10683 $(window).on('scroll.hsps',homeSliderParallaxScroll); 10684 $(window).off('resize.hsps'); 10685 $(window).on('resize.hsps',homeSliderMobile); 10686 10687 } 10688 10689 //cart dropdown 10690 $('#header-outer div.cart-outer').hoverIntent(function(){ 10691 $('#header-outer .widget_shopping_cart').stop(true,true).fadeIn(400); 10692 $('#header-outer .cart_list').stop(true,true).fadeIn(400); 10693 clearTimeout(timeout); 10694 $('#header-outer .cart-notification').fadeOut(300);
10695 }); 10696 10697 10698 //remove excess loading images now 10699 $('.portfolio-loading, .nectar-slider-loading .loading-icon').remove(); 10700 10701 setTimeout(portfolioSidebarFollow,250); 10702 setTimeout(portfolioSidebarFollow,500); 10703 setTimeout(portfolioSidebarFollow,1000); 10704 10705 crossBrowserFixes(); 10706 10707 10708 $(window).trigger('resize'); 10709 10710 //fix admin bar 10711 $("#wpadminbar").show(); 10712 10713 10714 //close widget area 10715 if($('#header-outer').hasClass('side-widget-open')) $('.slide-out-widget-area-toggle a').trigger('click'); 10716 10717 //fade in page 10718 setTimeout(function(){ $('#ajax-loading-screen').stop(true,true).fadeOut(500, function(){ $('#ajax-loading-screen .loading-icon').css({'opacity':0}); }); closeSearch(); },200); 10719 setTimeout(function(){ $('#ajax-loading-screen').stop(true,true).fadeOut(500, function(){ $('#ajax-loading-screen .loading-icon').css({'opacity':0}); }); closeSearch(); },900); 10720 } 10721 10722 10723 10724 10725 10726 10727 10728/* 10729 * jQuery Textarea Characters Counter Plugin v 2.0 10730 * Examples and documentation at: http://roy-jin.appspot.com/jsp/textareaCounter.jsp 10731 * Copyright (c) 2010 Roy Jin 10732 * Version: 2.0 (11-JUN-2010) 10733 * Dual licensed under the MIT and GPL licenses: 10734 * http://www.opensource.org/licenses/mit-license.php 10735 * http://www.gnu.org/licenses/gpl.html 10736 * Requires: jQuery v1.4.2 or later 10737 */ 10738(function($){ 10739 if(!$.fn.textareaCount) { 10740 $.fn.textareaCount = function(options, fn) { 10741 var defaults = { 10742 maxCharacterSize: -1, 10743 originalStyle: 'originalTextareaInfo', 10744 warningStyle: 'warningTextareaInfo', 10745 warningNumber: 20, 10746 displayFormat: '#input characters | #words words' 10747 }; 10748 10749 var options = $.extend(defaults, options); 10750 10751 var container = $(this); 10752 10753 $("<div class='charleft'> </div>").insertAfter(container); 10754 10755 10756 //create charleft css 10757 var charLeftCss = { 10758 'width' : container.width() 10759 }; 10760 10761 var charLeftInfo = getNextCharLeftInformation(container); 10762 charLeftInfo.addClass(options.originalStyle); 10763 //charLeftInfo.css(charLeftCss); 10764 10765 10766 var numInput = 0; 10767 var maxCharacters = options.maxCharacterSize; 10768 var numLeft = 0; 10769 var numWords = 0; 10770 10771 container.bind('keyup', function(event){limitTextAreaByCharacterCount();}) 10772 .bind('mouseover', function(event){setTimeout(function(){limitTextAreaByCharacterCount();}, 10);}) 10773 .bind('paste', function(event){setTimeout(function(){limitTextAreaByCharacterCount();}, 10);}); 10774 10775 limitTextAreaByCharacterCount(); 10776 10777 function limitTextAreaByCharacterCount(){ 10778 charLeftInfo.html(countByCharacters()); 10779 10780 //function call back 10781 if(typeof fn != 'undefined'){ 10782 fn.call(this, getInfo()); 10783 } 10784 return true; 10785 } 10786 10787 function countByCharacters(){ 10788 var content = container.val(); 10789 var contentLength = content.length; 10790 //Start Cut 10791 if(options.maxCharacterSize > 0){ 10792 //If copied content is already more than maxCharacterSize, chop it to maxCharacterSize. 10793 if(contentLength >= options.maxCharacterSize) { 10794 content = content.substring(0, options.maxCharacterSize); 10795 } 10796 10797 var newlineCount = getNewlineCount(content); 10798 10799 // newlineCount new line character. For windows, it occupies 2 characters 10800 var systemmaxCharacterSize = options.maxCharacterSize - newlineCount; 10801 if (!isWin()){ 10802 systemmaxCharacterSize = options.maxCharacterSize 10803 } 10804 if(contentLength > systemmaxCharacterSize){ 10805 //avoid scroll bar moving 10806 var originalScrollTopPosition = this.scrollTop; 10807 container.val(content.substring(0, systemmaxCharacterSize)); 10808 this.scrollTop = originalScrollTopPosition; 10809 } 10810 charLeftInfo.removeClass(options.warningStyle); 10811 if(systemmaxCharacterSize - contentLength <= options.warningNumber){ 10812 charLeftInfo.addClass(options.warningStyle); 10813 } 10814 10815 numInput = container.val().length + newlineCount; 10816 if(!isWin()){ 10817 numInput = container.val().length; 10818 } 10819 10820 numWords = countWord(getCleanedWordString(container.val())); 10821 10822 numLeft = maxCharacters - numInput; 10823 } else { 10824 //normal count, no cut 10825 var newlineCount = getNewlineCount(content); 10826 numInput = container.val().length + newlineCount; 10827 if(!isWin()){ 10828 numInput = container.val().length; 10829 } 10830 numWords = countWord(getCleanedWordString(container.val())); 10831 } 10832 10833 return formatDisplayInfo(); 10834 } 10835 10836 function formatDisplayInfo(){ 10837 var format = options.displayFormat; 10838 format = format.replace('#input', numInput); 10839 format = format.replace('#words', numWords); 10840 //When maxCharacters <= 0, #max, #left cannot be substituted. 10841 if(maxCharacters > 0){ 10842 format = format.replace('#max', maxCharacters); 10843 format = format.replace('#left', numLeft); 10844 } 10845 return format; 10846 } 10847 10848 function getInfo(){ 10849 var info = { 10850 input: numInput, 10851 max: maxCharacters, 10852 left: numLeft, 10853 words: numWords 10854 }; 10855 return info; 10856 } 10857 10858 function getNextCharLeftInformation(container){ 10859 return container.next('.charleft'); 10860 } 10861 10862 function isWin(){ 10863 var strOS = navigator.appVersion; 10864 if (strOS.toLowerCase().indexOf('win') != -1){ 10865 return true; 10866 } 10867 return false; 10868 } 10869 10870 function getNewlineCount(content){ 10871 var newlineCount = 0; 10872 for(var i=0; i<content.length;i++){ 10873 if(content.charAt(i) == '\n'){ 10874 newlineCount++; 10875 } 10876 } 10877 return newlineCount; 10878 } 10879 10880 function getCleanedWordString(content){ 10881 var fullStr = content + " "; 10882 var initial_whitespace_rExp = /^[^A-Za-z0-9]+/gi; 10883 var left_trimmedStr = fullStr.replace(initial_whitespace_rExp, ""); 10884 var non_alphanumerics_rExp = rExp = /[^A-Za-z0-9]+/gi; 10885 var cleanedStr = left_trimmedStr.replace(non_alphanumerics_rExp, " "); 10886 var splitString = cleanedStr.split(" "); 10887 return splitString; 10888 } 10889 10890 function countWord(cleanedWordString){ 10891 var word_count = cleanedWordString.length-1; 10892 return word_count; 10893 } 10894 }; 10895 } 10896})(jQuery); 10897 10898 10899 10900 10901}); 10902 10903 10904 10905function resizeIframe() { 10906 var element = document.getElementById("pp_full_res").getElementsByTagName("iframe"); 10907 var height = element[0].contentWindow.document.body.scrollHeight; 10908 10909 //iframe height 10910 element[0].style.height = height + 'px'; 10911 10912 //pp height 10913 document.getElementsByClassName("pp_content_container")[0].style.height = height+40+ 'px'; 10914 document.getElementsByClassName("pp_content")[0].style.height = height+40+ 'px'; 10915 10916} 10917 10918 10919//don't load if mobile 10920if(!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/) ){ 10921 10922 10923 /* 10924 panr - v0.0.1 by Robert Bue (@robert_bue) 10925 */ 10926 ;(function ( $, window, document, undefined ) { 10927 // Create the defaults once 10928 10929 var pluginName = "panr", 10930 defaults = { 10931 sensitivity: 22, 10932 moveTarget: "parent", 10933 scale: false, 10934 scaleOnHover: false, 10935 scaleTo: 1.1, 10936 scaleDuration: .28, 10937 panY: true, 10938 panX: true, 10939 panDuration: 0.7, 10940 resetPanOnMouseLeave: true, 10941 onEnter: function(){}, 10942 onLeave: function(){} 10943 }; 10944 // The actual plugin constructor 10945 function Plugin ( element, options ) { 10946 this.element = element; 10947 //console.log(element); 10948 this.settings = $.extend( {}, defaults, options ); 10949 this._defaults = defaults; 10950 this._name = pluginName; 10951 this.init(); 10952 } 10953 Plugin.prototype = { 10954 init: function () { 10955 if ( Modernizr.touch ) { 10956 return; 10957 } 10958 // call them like so: this.yourOtherFunction(this.element, this.settings). 10959 //console.log(this.settings); 10960 var settings = this.settings, 10961 target = $(this.element), 10962 w = target.width(), 10963 targetWidth = target.width() - settings.sensitivity, 10964 cx = (w-targetWidth)/targetWidth, 10965 x, 10966 y, 10967 panVars, 10968 xPanVars, 10969 yPanVars, 10970 mouseleaveVars; 10971 //console.log(cx); 10972 if ( settings.scale || (!settings.scaleOnHover && settings.scale) ) { 10973 TweenMax.set(target, { scale: settings.scaleTo }); 10974 } 10975 // If no target provided we'll use the hovered element 10976 if ( !settings.moveTarget ) { 10977 settings.moveTarget = $(this.element); 10978 } 10979 if ( settings.moveTarget == "parent" ) { 10980 settings.moveTarget = $(this.element).parent(); 10981 } 10982 if ( settings.moveTarget == "parent parent" ) { 10983 settings.moveTarget = $(this.element).parent().parent(); 10984 } 10985 if ( settings.moveTarget == "parent parent parent" ) { 10986 settings.moveTarget = $(this.element).parent().parent().parent(); 10987 } 10988 10989 settings.moveTarget.on('mousemove', function(e){
10990 x = e.pageX - target.offset().left - target.width()/2; // mouse x coordinate relative to the container 10991 y = e.pageY - target.offset().top - target.height()/2; // mouse x coordinate relative to the container 10992 if ( settings.panX ) { 10993 xPanVars = { x: -cx*x }; 10994 } 10995 if ( settings.panY ) { 10996 yPanVars = { y: -cx*y }; 10997 } 10998 panVars = $.extend({}, xPanVars, yPanVars); 10999 11000 // Pan element 11001 TweenMax.to(target, settings.panDuration, panVars); 11002 }); 11003 // On mouseover 11004 settings.moveTarget.on('mouseenter', function(e){ 11005 // Scale up element 11006 TweenMax.to(target, settings.scaleDuration, { scale: settings.scaleTo }); 11007 settings.onEnter(target); 11008 }); 11009 if ( !settings.scale || (!settings.scaleOnHover && !settings.scale) ) { 11010 mouseleaveVars = { scale: 1.005, x: 0, y: 0 }; 11011 } else { 11012 11013 if ( settings.resetPanOnMouseLeave ) { 11014 mouseleaveVars = { x: 0, y: 0 }; 11015 } 11016 } 11017 settings.moveTarget.on('mouseleave', function(e){ 11018 // Reset element 11019 TweenMax.to(target, .35, mouseleaveVars ); 11020 settings.onLeave(target); 11021 }); 11022 } 11023 }; 11024 // A really lightweight plugin wrapper around the constructor, 11025 // preventing against multiple instantiations 11026 $.fn[ pluginName ] = function ( options ) { 11027 return this.each(function() { 11028 if ( !$.data( this, "plugin_" + pluginName ) ) { 11029 $.data( this, "plugin_" + pluginName, new Plugin( this, options ) ); 11030 } 11031 }); 11032 }; 11033 })( jQuery, window, document ); 11034 11035} 11036 11037 11038 11039/*! 11040 * hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+ 11041 * http://cherne.net/brian/resources/jquery.hoverIntent.html 11042 */ 11043(function(e){e.fn.hoverIntent=function(t,n,r){var i={interval:100,sensitivity:7,timeout:0};if(typeof t==="object"){i=e.extend(i,t)}else if(e.isFunction(n)){i=e.extend(i,{over:t,out:n,selector:r})}else{i=e.extend(i,{over:t,out:t,selector:n})}var s,o,u,a;var f=function(e){s=e.pageX;o=e.pageY};var l=function(t,n){n.hoverIntent_t=clearTimeout(n.hoverIntent_t);if(Math.abs(u-s)+Math.abs(a-o)<i.sensitivity){e(n).off("mousemove.hoverIntent",f);n.hoverIntent_s=1;return i.over.apply(n,[t])}else{u=s;a=o;n.hoverIntent_t=setTimeout(function(){l(t,n)},i.interval)}};var c=function(e,t){t.hoverIntent_t=clearTimeout(t.hoverIntent_t);t.hoverIntent_s=0;return i.out.apply(t,[e])};var h=function(t){var n=jQuery.extend({},t);var r=this;if(r.hoverIntent_t){r.hoverIntent_t=clearTimeout(r.hoverIntent_t)}if(t.type=="mouseenter"){u=n.pageX;a=n.pageY;e(r).on("mousemove.hoverIntent",f);if(r.hoverIntent_s!=1){r.hoverIntent_t=setTimeout(function(){l(n,r)},i.interval)}}else{e(r).off("mousemove.hoverIntent",f);if(r.hoverIntent_s==1){r.hoverIntent_t=setTimeout(function(){c(n,r)},i.timeout)}}};return this.on({"mouseenter.hoverIntent":h,"mouseleave.hoverIntent":h},i.selector)}})(jQuery)
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.