This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('.eda-module-type-slider .slides').imagesLoaded(function () { | |
| //console.log('all images loaded'); | |
| $('.eda-module-type-slider .slides').addClass('images-loaded'); | |
| $('.eda-module-type-slider').each(function (index, value) { | |
| var slides = $(this).find('.slide'); | |
| if (slides.length > 1) { | |
| jFadeBanner($(this)); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * Get Viewport Dimensions | |
| * returns object with viewport dimensions to match css in width and height properties | |
| * ( source: http://andylangton.co.uk/blog/development/get-viewport-size-width-and-height-javascript ) | |
| */ | |
| function updateViewportDimensions() { | |
| var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight; | |
| return { width:x,height:y }; | |
| } | |
| // setting the viewport width | |
| var viewport = updateViewportDimensions(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('.current-post-ancestor').each(function(i, e) { | |
| $(this).closest('.menu-item-has-children').addClass('current-post-ancestor'); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* If is visible in viewport */ | |
| $.fn.isInViewport = function() { | |
| var element = this; | |
| var elementHeight = element.outerHeight(); | |
| var scrollTop = $(window).scrollTop(); | |
| var viewportHeight = $( window ).height(); | |
| var elementOffset = element.offset(); | |
| var inViewportHeight = elementHeight + viewportHeight; | |
| if ((scrollTop + viewportHeight) > elementOffset.top && scrollTop < (elementOffset.top + elementHeight) ) { | |
| return (((scrollTop + viewportHeight - elementOffset.top) / inViewportHeight) * 100).toFixed(3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Toggle submenus */ | |
| $('.megamenu-container .expander').click(function(){ | |
| $(this).parent().toggleClass('current-menu-item'); | |
| }); | |
| /* Toggle desktop submenus */ | |
| $('.megamenu-container .sub-menu-container .expander').click(function(){ | |
| $(this).parent().toggleClass('current-menu-drop'); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function applePie() { | |
| return ( navigator.userAgent.match(/(iPhone|iPod|iPad)/i) ); | |
| } | |
| $('.fancy-overlay').fancybox({ | |
| your: 'settings', | |
| afterShow: function() { | |
| if ( applePie() ) { $('body').css({'position': 'fixed'}); } | |
| }, | |
| afterClose: function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function reserveHeaderSpace() { | |
| if (!$('body').hasClass('not-top')) { | |
| var headerHeight = $('header.header').outerHeight(); | |
| if (!$('body').hasClass("mobile-menu-visible")) { | |
| if (!$('body').hasClass("search-visible")) { | |
| $('.content-wrap').css('padding-top', headerHeight); | |
| } | |
| } | |
| } else { | |
| $('.content-wrap').css('padding-top', ''); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function outMenu() { | |
| var openHeader = $('header.header > .container').outerHeight(); | |
| var headerBlock = $('.eda-module-type-slider .outer'); | |
| //console.log(openHeader); | |
| var scrollDistance = $(window).scrollTop(); | |
| //console.log('scroll ' + scrollDistance); | |
| var windowHeight = $(window).outerHeight(); | |
| //console.log('window ' + windowHeight); | |
| var sliderHeight = $('.eda-module-type-slider').outerHeight(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Make jQuery work | |
| var script = document.createElement('script'); | |
| script.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js";document.getElementsByTagName('head')[0].appendChild(script); | |
| // Create a div | |
| $0.appendChild(document.createElement('div')); | |
| // Disable CSS | |
| $('style,link[rel="stylesheet"]').remove(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @font-face { | |
| font-family: 'bariol_boldbold'; | |
| src: url('Bariol_Bold.otf') format('opentype'); | |
| font-weight: normal; | |
| font-style: normal; | |
| } |