/*-----------------------------------------------------------------------------------*/ /* Mian Js Start /*-----------------------------------------------------------------------------------*/ $(document).ready(function($) { "use strict" /*-----------------------------------------------------------------------------------*/ /* LOADER /*-----------------------------------------------------------------------------------*/ $("#loader").delay(500).fadeOut("slow"); /*-----------------------------------------------------------------------------------*/ /* Top Bar /*-----------------------------------------------------------------------------------*/ $("#info").on('click', function(){ $(".hidden2").slideToggle(); }); // search in menu var $search_btn = $( '.search-box > i' ), $search_form = $( 'form.search-form' ); $search_btn.on( 'click', function () { $search_form.toggleClass( 'open' ); } ); $( document ).on( 'click', function ( e ) { if ( $( e.target ).closest( $search_btn ).length == 0 && $( e.target ).closest( 'input.search-field' ).length == 0 && $search_form.hasClass( 'open' ) ) { $search_form.removeClass( 'open' ); } } ); var snapper = new Snap( { element: document.getElementById( 'page' ), dragger: document.getElementsByClassName( 'page' ), disable: 'right', slideIntent: 10, } ); var addEvent = function addEvent( element, eventName, func ) { if ( element.addEventListener ) { return element.addEventListener( eventName, func, false ); } else if ( element.attachEvent ) { return element.attachEvent( "on" + eventName, func ); } }; addEvent( document.getElementById( 'open-left' ), 'click', function () { snapper.open( 'left' ); } ); /*-----------------------------------------------------------------------------------*/ /* GALLERY SLIDER /*-----------------------------------------------------------------------------------*/ $('.gallery-slider').owlCarousel({ loop:true, margin:30, nav:true, navText: ["",""], responsive:{ 0:{ items:1 }, 600:{ items:3 }, 1000:{ items:4 } }}); /*-----------------------------------------------------------------------------------*/ /* Magnific Popup /*-----------------------------------------------------------------------------------*/ try { $(document).ready(function() { $('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({ disableOn: 700, type: 'iframe', mainClass: 'mfp-fade', removalDelay: 160, preloader: false, fixedContentPos: false }); }); } catch (err) { } try { $('.popup-image').magnificPopup({ type: 'image', closeOnContentClick: true, mainClass: 'mfp-img-mobile', image: { verticalFit: true } }); } catch (err) { } try { $('.popup-gallery').magnificPopup({ delegate: 'a', type: 'image', tLoading: 'Loading image #%curr%...', mainClass: 'mfp-img-mobile', gallery: { enabled: true, navigateByImgClick: true, preload: [0,1] // Will preload 0 - before current, and 1 after the current image }, image: { tError: 'The image #%curr% could not be loaded.', titleSrc: function(item) { return item.el.attr('title') + 'by Max Themes'; } } }); } catch (err) { } /*-----------------------------------------------------------------------------------*/ /* CUBE PORTFOLIO /*-----------------------------------------------------------------------------------*/ $('.ajax-work').cubeportfolio({ filters: '#ajax-work-filter', loadMore: '#ajax-loadMore', loadMoreAction: 'click', layoutMode: 'grid', defaultFilter: '*', animationType: 'scaleSides', gapHorizontal: 30, gapVertical: 30, gridAdjustment: 'responsive', mediaQueries: [{ width: 1500, cols: 3 }, { width: 1100, cols: 3 }, { width: 480, cols: 2 }, { width: 320, cols: 1 }], caption: 'zoom', displayType: 'lazyLoading', displayTypeSpeed: 400, // singlePage popup singlePageDelegate: '.cbp-singlePage', singlePageDeeplinking: true, singlePageStickyNavigation: true, singlePageCounter: '