// Set jQuery $ variable (function ($) { $(document); // Enable responsive menus ( function( window, $, undefined ) { 'use strict'; $( 'nav' ).before( '' ); // Add toggles to menus $( 'nav .sub-menu' ).before( '' ); // Add toggles to sub menus // Show/hide the navigation $( '.menu-toggle, .sub-menu-toggle' ).on( 'click', function() { var $this = $( this ); $this.attr( 'aria-pressed', function( index, value ) { return 'false' === value ? 'true' : 'false'; }); $this.toggleClass( 'activated' ); $this.next( 'nav, .sub-menu' ).slideToggle( 'fast' ); }); })( this, jQuery ); //Configure stick nav function sticky_relocate() { var window_top = $(window).scrollTop(); var div_top = $('#sticky-anchor').offset().top; if (window_top > div_top) { $('#header-fill').addClass('stick'); } else { $('#header-fill').removeClass('stick'); } } $(function () { $(window).scroll(sticky_relocate); sticky_relocate(); }); //Init Isotope var container = document.querySelector('#isotope-container'); if ( container != null ){ $( ".item.masonry-post" ).addClass( "isotope" ) // layout Masonry again after all images have loaded imagesLoaded( container, function() { var $container = $('#isotope-container'); // init $container.isotope({ // options itemSelector: '.item', layoutMode: 'fitRows' }); $( ".item.masonry-post" ).css( "opacity", "1" ) }); } //Init Isotope masonry layout var container = document.querySelector('#masonry-container'); if ( container != null ){ // layout Masonry again after all images have loaded imagesLoaded( container, function() { var $container = $('#masonry-container'); // init $container.isotope({ itemSelector: '.item', layoutMode: 'masonry', masonry: { gutter: '.gutter-sizer' }, percentPosition: true }); $( ".item.masonry-post" ).css( "opacity", "1" ) }); } //Init Flickity var flickContainer = document.querySelector('.main-gallery'); if ( flickContainer != null ){ imagesLoaded( flickContainer, function() { $('.main-gallery').flickity({ // options cellAlign: 'center', cellSelector: '.home-gallery-cell', wrapAround: true, pageDots: false, imagesLoaded: true, autoPlay: parseInt( KindredSlider.delay, 10 ), draggable: eval( KindredSlider.draggable ), prevNextButtons: eval( KindredSlider.arrows ), }); }); var imgLoad = imagesLoaded( flickContainer ); var $gallery = jQuery('.main-gallery'); var $gallerycells = $gallery.find('.home-gallery-cell'); imgLoad.on( 'done', function( instance ) { $gallerycells.css( "opacity", "1" ); }); } //Support Recipe Print function printDiv(divName) { alert('s'); var printContents = document.getElementById(divName).innerHTML; w=window.open(); w.document.write(printContents); w.print(); w.close(); } }(jQuery)); //End jQuery