=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:[],right:[]}},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))}();
!function(e,t,n){function a(t,n){this.element=t,this.settings=e.extend({},i,n),this.settings.duplicate||n.hasOwnProperty(«removeIds»)||(this.settings.removeIds=!1),this._defaults=i,this._name=s,this.init()}var i={label:»MENU»,duplicate:!0,duration:200,easingOpen:»swing»,easingClose:»swing»,closedSymbol:»►»,openedSymbol:»▼»,prependTo:»body»,appendTo:»»,parentTag:»a»,closeOnClick:!1,allowParentLinks:!1,nestedParentLinks:!0,showChildren:!1,removeIds:!0,removeClasses:!1,removeStyles:!1,brand:»»,animations:»jquery»,init:function(){},beforeOpen:function(){},beforeClose:function(){},afterOpen:function(){},afterClose:function(){}},s=»slicknav»,o=»slicknav»,l={DOWN:40,ENTER:13,ESCAPE:27,LEFT:37,RIGHT:39,SPACE:32,TAB:9,UP:38};a.prototype.init=function(){var n,a,i=this,s=e(this.element),r=this.settings;if(r.duplicate?i.mobileNav=s.clone():i.mobileNav=s,r.removeIds&&(i.mobileNav.removeAttr(«id»),i.mobileNav.find(«*»).each(function(t,n){e(n).removeAttr(«id»)})),r.removeClasses&&(i.mobileNav.removeAttr(«class»),i.mobileNav.find(«*»).each(function(t,n){e(n).removeAttr(«class»)})),r.removeStyles&&(i.mobileNav.removeAttr(«style»),i.mobileNav.find(«*»).each(function(t,n){e(n).removeAttr(«style»)})),n=o+»_icon»,»»===r.label&&(n+=» «+o+»_no-text»),»a»==r.parentTag&&(r.parentTag=’a href=»#»‘),i.mobileNav.attr(«class»,o+»_nav»),a=e(»),»»!==r.brand){var c=e(‘
‘+r.brand+»
«);e(a).append(c)}i.btn=e([«<"+r.parentTag+' aria-haspopup="true" role="button" tabindex="0" class="'+o+"_btn "+o+'_collapsed">‘,'»,’‘,’‘,’‘,’‘,»«,»»+r.parentTag+»>»].join(«»)),e(a).append(i.btn),»»!==r.appendTo?e(r.appendTo).append(a):e(r.prependTo).prepend(a),a.append(i.mobileNav);var p=i.mobileNav.find(«li»);e(p).each(function(){var t=e(this),n={};if(n.children=t.children(«ul»).attr(«role»,»menu»),t.data(«menu»,n),n.children.length>0){var a=t.contents(),s=!1,l=[];e(a).each(function(){return e(this).is(«ul»)?!1:(l.push(this),void(e(this).is(«a»)&&(s=!0)))});var c=e(«<"+r.parentTag+' role="menuitem" aria-haspopup="true" tabindex="-1" class="'+o+'_item"/>‘);if(r.allowParentLinks&&!r.nestedParentLinks&&s)e(l).wrapAll(‘‘).parent();else{var p=e(l).wrapAll(c).parent();p.addClass(o+»_row»)}r.showChildren?t.addClass(o+»_open»):t.addClass(o+»_collapsed»),t.addClass(o+»_parent»);var d=e(‘‘+(r.showChildren?r.openedSymbol:r.closedSymbol)+»«);r.allowParentLinks&&!r.nestedParentLinks&&s&&(d=d.wrap(c).parent()),e(l).last().after(d)}else 0===t.children().length&&t.addClass(o+»_txtnode»);t.children(«a»).attr(«role»,»menuitem»).click(function(t){r.closeOnClick&&!e(t.target).parent().closest(«li»).hasClass(o+»_parent»)&&e(i.btn).click()}),r.closeOnClick&&r.allowParentLinks&&(t.children(«a»).children(«a»).click(function(t){e(i.btn).click()}),t.find(«.»+o+»_parent-link a:not(.»+o+»_item)»).click(function(t){e(i.btn).click()}))}),e(p).each(function(){var t=e(this).data(«menu»);r.showChildren||i._visibilityToggle(t.children,null,!1,null,!0)}),i._visibilityToggle(i.mobileNav,null,!1,»init»,!0),i.mobileNav.attr(«role»,»menu»),e(t).mousedown(function(){i._outlines(!1)}),e(t).keyup(function(){i._outlines(!0)}),e(i.btn).click(function(e){e.preventDefault(),i._menuToggle()}),i.mobileNav.on(«click»,».»+o+»_item»,function(t){t.preventDefault(),i._itemClick(e(this))}),e(i.btn).keydown(function(t){var n=t||event;switch(n.keyCode){case l.ENTER:case l.SPACE:case l.DOWN:t.preventDefault(),n.keyCode===l.DOWN&&e(i.btn).hasClass(o+»_open»)||i._menuToggle(),e(i.btn).next().find(‘[role=»menuitem»]’).first().focus()}}),i.mobileNav.on(«keydown»,».»+o+»_item»,function(t){var n=t||event;switch(n.keyCode){case l.ENTER:t.preventDefault(),i._itemClick(e(t.target));break;case l.RIGHT:t.preventDefault(),e(t.target).parent().hasClass(o+»_collapsed»)&&i._itemClick(e(t.target)),e(t.target).next().find(‘[role=»menuitem»]’).first().focus()}}),i.mobileNav.on(«keydown»,'[role=»menuitem»]’,function(t){var n=t||event;switch(n.keyCode){case l.DOWN:t.preventDefault();var a=e(t.target).parent().parent().children().children(‘[role=»menuitem»]:visible’),s=a.index(t.target),r=s+1;a.length<=r&&(r=0);var c=a.eq(r);c.focus();break;case l.UP:t.preventDefault();var a=e(t.target).parent().parent().children().children('[role="menuitem"]:visible'),s=a.index(t.target),c=a.eq(s-1);c.focus();break;case l.LEFT:if(t.preventDefault(),e(t.target).parent().parent().parent().hasClass(o+"_open")){var p=e(t.target).parent().parent().prev();p.focus(),i._itemClick(p)}else e(t.target).parent().parent().hasClass(o+"_nav")&&(i._menuToggle(),e(i.btn).focus());break;case l.ESCAPE:t.preventDefault(),i._menuToggle(),e(i.btn).focus()}}),r.allowParentLinks&&r.nestedParentLinks&&e("."+o+"_item a").click(function(e){e.stopImmediatePropagation()})},a.prototype._menuToggle=function(e){var t=this,n=t.btn,a=t.mobileNav;n.hasClass(o+"_collapsed")?(n.removeClass(o+"_collapsed"),n.addClass(o+"_open")):(n.removeClass(o+"_open"),n.addClass(o+"_collapsed")),n.addClass(o+"_animating"),t._visibilityToggle(a,n.parent(),!0,n)},a.prototype._itemClick=function(e){var t=this,n=t.settings,a=e.data("menu");a||(a={},a.arrow=e.children("."+o+"_arrow"),a.ul=e.next("ul"),a.parent=e.parent(),a.parent.hasClass(o+"_parent-link")&&(a.parent=e.parent().parent(),a.ul=e.parent().next("ul")),e.data("menu",a)),a.parent.hasClass(o+"_collapsed")?(a.arrow.html(n.openedSymbol),a.parent.removeClass(o+"_collapsed"),a.parent.addClass(o+"_open"),a.parent.addClass(o+"_animating"),t._visibilityToggle(a.ul,a.parent,!0,e)):(a.arrow.html(n.closedSymbol),a.parent.addClass(o+"_collapsed"),a.parent.removeClass(o+"_open"),a.parent.addClass(o+"_animating"),t._visibilityToggle(a.ul,a.parent,!0,e))},a.prototype._visibilityToggle=function(t,n,a,i,s){function l(t,n){e(t).removeClass(o+"_animating"),e(n).removeClass(o+"_animating"),s||p.afterOpen(t)}function r(n,a){t.attr("aria-hidden","true"),d.attr("tabindex","-1"),c._setVisAttr(t,!0),t.hide(),e(n).removeClass(o+"_animating"),e(a).removeClass(o+"_animating"),s?"init"==n&&p.init():p.afterClose(n)}var c=this,p=c.settings,d=c._getActionItems(t),u=0;a&&(u=p.duration),t.hasClass(o+"_hidden")?(t.removeClass(o+"_hidden"),s||p.beforeOpen(i),"jquery"===p.animations?t.stop(!0,!0).slideDown(u,p.easingOpen,function(){l(i,n)}):"velocity"===p.animations&&t.velocity("finish").velocity("slideDown",{duration:u,easing:p.easingOpen,complete:function(){l(i,n)}}),t.attr("aria-hidden","false"),d.attr("tabindex","0"),c._setVisAttr(t,!1)):(t.addClass(o+"_hidden"),s||p.beforeClose(i),"jquery"===p.animations?t.stop(!0,!0).slideUp(u,this.settings.easingClose,function(){r(i,n)}):"velocity"===p.animations&&t.velocity("finish").velocity("slideUp",{duration:u,easing:p.easingClose,complete:function(){r(i,n)}}))},a.prototype._setVisAttr=function(t,n){var a=this,i=t.children("li").children("ul").not("."+o+"_hidden");n?i.each(function(){var t=e(this);t.attr("aria-hidden","true");var i=a._getActionItems(t);i.attr("tabindex","-1"),a._setVisAttr(t,n)}):i.each(function(){var t=e(this);t.attr("aria-hidden","false");var i=a._getActionItems(t);i.attr("tabindex","0"),a._setVisAttr(t,n)})},a.prototype._getActionItems=function(e){var t=e.data("menu");if(!t){t={};var n=e.children("li"),a=n.find("a");t.links=a.add(n.find("."+o+"_item")),e.data("menu",t)}return t.links},a.prototype._outlines=function(t){t?e("."+o+"_item, ."+o+"_btn").css("outline",""):e("."+o+"_item, ."+o+"_btn").css("outline","none")},a.prototype.toggle=function(){var e=this;e._menuToggle()},a.prototype.open=function(){var e=this;e.btn.hasClass(o+"_collapsed")&&e._menuToggle()},a.prototype.close=function(){var e=this;e.btn.hasClass(o+"_open")&&e._menuToggle()},e.fn[s]=function(t){var n=arguments;if(void 0===t||"object"==typeof t)return this.each(function(){e.data(this,"plugin_"+s)||e.data(this,"plugin_"+s,new a(this,t))});if("string"==typeof t&&"_"!==t[0]&&"init"!==t){var i;return this.each(function(){var o=e.data(this,"plugin_"+s);o instanceof a&&"function"==typeof o[t]&&(i=o[t].apply(o,Array.prototype.slice.call(n,1)))}),void 0!==i?i:this}}}(jQuery,document,window);
/*!
* Masonry PACKAGED v4.2.1
* Cascading grid layout library
* https://masonry.desandro.com
* MIT License
* by David DeSandro
*/
!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,a){function h(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var d=u[e];if(!d||"_"==e.charAt(0))return void s(r+" is not a valid method");var l=d.apply(u,n);o=void 0===o?l:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;oe;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a(«Style returned «+e+». Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1″),e}function o(){if(!d){d=!0;var e=document.createElement(«div»);e.style.width=»200px»,e.style.padding=»1px 2px 3px 4px»,e.style.borderStyle=»solid»,e.style.borderWidth=»1px 2px 3px 4px»,e.style.boxSizing=»border-box»;var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);r.isBoxSizeOuter=s=200==t(o.width),i.removeChild(e)}}function r(e){if(o(),»string»==typeof e&&(e=document.querySelector(e)),e&&»object»==typeof e&&e.nodeType){var r=n(e);if(«none»==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox=»border-box»==r.boxSizing,l=0;u>l;l++){var c=h[l],f=r[c],m=parseFloat(f);a[c]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,E=d&&s,b=t(r.width);b!==!1&&(a.width=b+(E?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(E?0:g+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+z),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a=»undefined»==typeof console?e:function(t){console.error(t)},h=[«paddingLeft»,»paddingRight»,»paddingTop»,»paddingBottom»,»marginLeft»,»marginRight»,»marginTop»,»marginBottom»,»borderLeftWidth»,»borderRightWidth»,»borderTopWidth»,»borderBottomWidth»],u=h.length,d=!1;return r}),function(t,e){«use strict»;»function»==typeof define&&define.amd?define(«desandro-matches-selector/matches-selector»,e):»object»==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){«use strict»;var t=function(){var t=window.Element.prototype;if(t.matches)return»matches»;if(t.matchesSelector)return»matchesSelector»;for(var e=[«webkit»,»moz»,»ms»,»o»],i=0;is?»round»:»floor»;r=Math[a](r),this.cols=Math.max(r,1)},n.getContainerWidth=function(){var t=this._getOption(«fitWidth»),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},n._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?»round»:»ceil»,n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this.options.horizontalOrder?»_getHorizontalColPosition»:»_getTopColPosition»,r=this[o](n,t),s={x:this.columnWidth*r.col,y:r.y},a=r.y+t.size.outerHeight,h=n+r.col,u=r.col;h>u;u++)this.colYs[u]=a;return s},n._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},n._getTopColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++)e[n]=this._getColGroupY(n,t);return e},n._getColGroupY=function(t,e){if(2>e)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},n._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,n=t>1&&i+t>this.cols;i=n?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},n._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption(«originLeft»),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption(«originTop»),d=(u?n.top:n.bottom)+i.outerHeight,l=a;h>=l;l++)this.colYs[l]=Math.max(d,this.colYs[l])},n._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption(«fitWidth»)&&(t.width=this._getContainerFitWidth()),t},n._getContainerFitWidth=function(){for(var t=0,e=this.cols;–e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i});
(function () {
‘use strict’;
// Animate loader off screen
$(window).on(‘load’, function() {
$(‘.spinner-cover’).fadeOut(‘slow’,function(){$(this).remove();});
});
var owlCarousel = function(){
$(‘#slider-small’).owlCarousel({
animateOut: ‘fadeOut’,
animateIn: ‘fadeIn’,
autoplay: true,
loop: true,
margin: 10,
dots: true,
nav: false,
smartSpeed:450,
responsive: {
0: {
items: 1
},
600: {
items: 2
},
1000: {
items: 4
}
}
});
$(‘#slider-carousel’).owlCarousel({
loop: true,
margin: 0,
dots: false,
nav: false,
responsive: {
0: {
items: 1
},
600: {
items: 3
},
1000: {
items: 3
}
},
smartSpeed:450,
navText : [««,»«]
});
$(‘#slideshow_face’).owlCarousel({
animateOut: ‘fadeOut’,
animateIn: ‘fadeIn’,
items:1,
margin:0,
stagePadding:0,
smartSpeed: 450,
autoplayTimeout: 10000,
autoplayHoverPause: true,
loop: true,
autoplay: true,
nav: true,
navText: [««, ««]
});
$(‘#slideshow_big’).owlCarousel({
animateOut: ‘fadeOut’,
animateIn: ‘fadeIn’,
items:1,
margin:0,
stagePadding:0,
smartSpeed: 450,
autoplayTimeout: 10000,
autoplayHoverPause: true,
loop: true,
autoplay:false,
nav: true,
navText : [««,»«]
});
};
var contentWayPoint = function() {
var i = 0;
$(‘.animate-box’).waypoint( function( direction ) {
if( direction === ‘down’ && !$(this.element).hasClass(‘animated-fast’) ) {
i++;
$(this.element).addClass(‘item-animate’);
setTimeout(function(){
$(‘body .animate-box.item-animate’).each(function(k){
var el = $(this);
setTimeout( function () {
var effect = el.data(‘animate-effect’);
if ( effect === ‘fadeIn’) {
el.addClass(‘fadeIn animated-fast’);
} else if ( effect === ‘fadeInLeft’) {
el.addClass(‘fadeInLeft animated-fast’);
} else if ( effect === ‘fadeInRight’) {
el.addClass(‘fadeInRight animated-fast’);
} else {
el.addClass(‘fadeInUp animated-fast’);
}
el.removeClass(‘item-animate’);
}, k * 50, ‘easeInOutExpo’ );
});
}, 100);
}
} , { offset: ‘85%’ } );
};
var goToTop = function() {
$(‘.js-gotop’).on(‘click’, function(event){
event.preventDefault();
$(‘html, body’).animate({
scrollTop: $(‘html’).offset().top
}, 500, ‘swing’);
return false;
});
$(window).scroll(function(){
var $win = $(window);
if ($win.scrollTop() > 200) {
$(‘.js-top’).addClass(‘active’);
} else {
$(‘.js-top’).removeClass(‘active’);
}
});
};
var slickNav = function() {
$(‘#main-menu’).slicknav({
label: ‘MENU’,
duration: 150,
allowParentLinks: true,
prependTo:’#nav’,
});
$(‘#sidebar-menu’).slicknav({
label: ‘MENU’,
duration: 150,
allowParentLinks: true,
prependTo:’.menu-main-menu-container’,
});
};
var cerrarmenu = false;
var OffCanvas = function() {
$(‘.off-canvas-toggle’).on(‘click’, function (event) {
if (cerrarmenu === false) {
$(«#wrapper»).addClass(«toggled»);
$(«#off-canvas-toggle»).addClass(«hidden»);
cerrarmenu = true;
} else {
$(«#wrapper»).removeClass(«toggled»);
$(«#off-canvas-toggle»).removeClass(«hidden»);
cerrarmenu = false;
}
});
$(‘.off-canvas-close’).on(‘click’, function(event){
$(«#wrapper»).removeClass(«toggled»);
});
$(document).mouseup(function (e){
var offcanvas = $(«#sidebar-wrapper»);
if (!offcanvas.is(e.target) && offcanvas.has(e.target).length === 0) {
$(«#wrapper»).removeClass(«toggled»);
}
});
};
var TopSearch = function() {
$(«.top-search»).on(‘click’, function(event) {
$(«.top-search-form»).slideDown();
});
$(document).mouseup(function (e){
var container = $(«.top-search-form»);
if (!container.is(e.target) && container.has(e.target).length === 0){
container.slideUp();
}
});
};
var SubMenu = function() {
$(«#sidebar-menu li.menu-item-has-children»).on({
click: function () {
if ($(this).children(«.sub-menu:first»).css(«display») != «block») {
$(‘.sub-menu’).removeAttr(«style»);
$(‘.sub-menu:first, .children:first’, this).stop(true, true).slideDown(‘fast’);
} else {
$(‘.sub-menu’).removeAttr(«style»);
}
}
});
$(«#main-menu li.menu-item-has-children»).on({
mouseenter: function () {
$(‘.sub-menu:first, .children:first’, this).stop(true, true).slideDown(‘fast’);
},
mouseleave: function () {
$(‘.sub-menu:first, .children:first’, this).stop(true, true).slideUp(‘fast’);
}
});
};
var MasonryGrid = function() {
$(‘.grid’).masonry({
itemSelector: ‘.grid-item’,
columnWidth: ‘.grid-sizer’,
percentPosition: true
});
};
var theiaSticky = function() {
$(‘.sidebar_right’).theiaStickySidebar({
additionalMarginTop: 30
});
};
var moreAticles = function() {
$(window).on(«scroll», function() {
var scrollHeight = $(document).height();
var bottomHeight = $(‘.bottom’).height() + 300;
var scrollPosition = $(window).height() + $(window).scrollTop();
var $more_articles = $(‘.single-more-articles’);
if ((scrollHeight – scrollPosition) < bottomHeight) {
$more_articles.addClass("single-more-articles--visible");
} else {
$more_articles.removeClass("single-more-articles--visible");
}
$(".single-more-articles-close-button").on('click', function(event) {
$more_articles.hide();
});
console.log(scrollHeight, scrollPosition, bottomHeight);
});
};
$(function(){
owlCarousel();
contentWayPoint();
goToTop();
slickNav();
OffCanvas();
TopSearch();
SubMenu();
MasonryGrid();
theiaSticky();
moreAticles();
});
}());
/* -------------------------------------
Smart sticky
-------------------------------------- */
( function ( document, window, index )
{
'use strict';
var elSelector = '.main-nav',
element = document.querySelector( elSelector );
if( !element ) return true;
var elHeight = 0,
elTop = 0,
dHeight = 40,
wHeight = 0,
wScrollCurrent = 0,
wScrollBefore = 0,
wScrollDiff = 0;
window.addEventListener( 'scroll', function()
{
elHeight = element.offsetHeight;
dHeight = document.body.offsetHeight;
wHeight = window.innerHeight;
wScrollCurrent = window.pageYOffset;
wScrollDiff = wScrollBefore - wScrollCurrent;
elTop = 0;
if( wScrollCurrent <= 0 ){ // scrolled to the very top; element sticks to the top
element.style.top = '0px';
element.style.position = 'relative';
$(".main-nav").removeClass("smartnav");
}
else if( wScrollDiff > 0 ) {// scrolled up; element slides in
element.style.top = ( elTop > 0 ? 0 : elTop ) + ‘px’;
element.style.position = ‘fixed’;
element.style.width = ‘100%’;
$(«.main-nav»).addClass(«smartnav»);
}
else if( wScrollDiff < 0 ) // scrolled down
{
if( wScrollCurrent + wHeight >= dHeight – elHeight ) // scrolled to the very bottom; element slides in
element.style.top = ( ( elTop = wScrollCurrent + wHeight – dHeight ) < 0 ? elTop : 0 ) + 'px';
else // scrolled down; element slides out
element.style.top = ( Math.abs( elTop ) > elHeight ? -elHeight : elTop ) + ‘px’;
}
wScrollBefore = wScrollCurrent;
});
}( document, window, 0 ));
/*!
* Theia Sticky Sidebar v1.7.0
* https://github.com/WeCodePixels/theia-sticky-sidebar
*
* Glues your website’s sidebars, making them permanently visible while scrolling.
*
* Copyright 2013-2016 WeCodePixels and other contributors
* Released under the MIT license
*/
(function ($) {
$.fn.theiaStickySidebar = function (options) {
var defaults = {
‘containerSelector’: »,
‘additionalMarginTop’: 0,
‘additionalMarginBottom’: 0,
‘updateSidebarHeight’: true,
‘minWidth’: 0,
‘disableOnResponsiveLayouts’: true,
‘sidebarBehavior’: ‘modern’,
‘defaultPosition’: ‘relative’,
‘namespace’: ‘TSS’
};
options = $.extend(defaults, options);
// Validate options
options.additionalMarginTop = parseInt(options.additionalMarginTop) || 0;
options.additionalMarginBottom = parseInt(options.additionalMarginBottom) || 0;
tryInitOrHookIntoEvents(options, this);
// Try doing init, otherwise hook into window.resize and document.scroll and try again then.
function tryInitOrHookIntoEvents(options, $that) {
var success = tryInit(options, $that);
if (!success) {
console.log(‘TSS: Body width smaller than options.minWidth. Init is delayed.’);
$(document).on(‘scroll.’ + options.namespace, function (options, $that) {
return function (evt) {
var success = tryInit(options, $that);
if (success) {
$(this).unbind(evt);
}
};
}(options, $that));
$(window).on(‘resize.’ + options.namespace, function (options, $that) {
return function (evt) {
var success = tryInit(options, $that);
if (success) {
$(this).unbind(evt);
}
};
}(options, $that))
}
}
// Try doing init if proper conditions are met.
function tryInit(options, $that) {
if (options.initialized === true) {
return true;
}
if ($(‘body’).width() < options.minWidth) {
return false;
}
init(options, $that);
return true;
}
// Init the sticky sidebar(s).
function init(options, $that) {
options.initialized = true;
// Add CSS
var existingStylesheet = $('#theia-sticky-sidebar-stylesheet-' + options.namespace);
if (existingStylesheet.length === 0) {
$('head').append($(''));
}
$that.each(function () {
var o = {};
o.sidebar = $(this);
// Save options
o.options = options || {};
// Get container
o.container = $(o.options.containerSelector);
if (o.container.length == 0) {
o.container = o.sidebar.parent();
}
// Create sticky sidebar
o.sidebar.parents().css('-webkit-transform', 'none'); // Fix for WebKit bug - https://code.google.com/p/chromium/issues/detail?id=20574
o.sidebar.css({
'position': o.options.defaultPosition,
'overflow': 'visible',
// The "box-sizing" must be set to "content-box" because we set a fixed height to this element when the sticky sidebar has a fixed position.
'-webkit-box-sizing': 'border-box',
'-moz-box-sizing': 'border-box',
'box-sizing': 'border-box'
});
// Get the sticky sidebar element. If none has been found, then create one.
o.stickySidebar = o.sidebar.find('.theiaStickySidebar');
if (o.stickySidebar.length == 0) {
// Remove
Más historias