jQuery(document).ready(function($) { "use strict"; $(".your_nav_bar_list_item_class").click(function(){ $(".your_nav_bar_list_item_class").toggleClass("open"); }): /* PrettyPhoto Script ======================================================*/ $('a[data-rel]').each(function () { $(this).attr('rel', $(this).data('rel')); $(".pretty-gallery a[rel^='prettyPhoto']").prettyPhoto(); }); /* Side Bar Menu Js ======================================================*/ if ($('#push, #close').length) { $('#push, #close').on('click', function(){ var $navigacia = $('body, #slide-menu'), val = $navigacia.css('left') === '300px' ? '0px' : '300px'; $navigacia.animate({ left: val }, 500) }); } /*STICKY HEADER ======================================================*/ if($('#tl_header-v1').length){ // grab the initial top offset of the navigation var stickyNavTop = $('#tl_header-v1').offset().top; // our function that decides weather the navigation bar should have "fixed" css position or not. var stickyNav = function(){ var scrollTop = $(window).scrollTop(); // our current vertical position from the top // if we've scrolled more than the navigation, change its position to fixed to stick to top, // otherwise change it back to relative if (scrollTop > stickyNavTop) { $('#tl_header-v1').addClass('tl_sticky'); } else { $('#tl_header-v1').removeClass('tl_sticky'); } }; stickyNav(); // and run it again every time you scroll $(window).scroll(function() { stickyNav(); }); } /*Home Banner ======================================================*/ if ($('#home-slider').length) { $('#home-slider').owlCarousel({ loop:true, dots: true, nav:true, navText:'', items:1, autoplay: false, smartSpeed:2000, }); } if ($('.post-slider').length) { $('.post-slider').owlCarousel({ loop:true, dots: true, nav:true, navText:'', items:1, autoplay: false, smartSpeed:2000, }); } /*Bx Post Slider ======================================================*/ if ($('#bx-slider').length) { $('#bx-slider').bxSlider({ auto:true }); } /* Owl Slider For Featured Section ======================================================*/ if ($('#tl-time-slider').length) { $('#tl-time-slider').owlCarousel({ loop:true, dots: false, nav:false, navText:'', items:4, smartSpeed:500, margin:0, responsiveClass:true, responsive:{ 0:{ items:1, }, 768:{ items:2, }, 1199:{ items:4, } } }); } /* PrettyPhoto Script ======================================================*/ $('a[data-rel]').each(function () { $(this).attr('rel', $(this).data('rel')); $(".pretty-gallery a[rel^='prettyPhoto']").prettyPhoto(); }); if ($('.gallery').length) { $(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({ animation_speed: 'normal', theme: 'light_square', slideshow: 3000, autoplay_slideshow: true }); $(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({ animation_speed: 'fast', slideshow: 10000, hideflash: true }); } }); /* MASONARY Gallery ======================================================*/ function attWorkGrid_1() { var options = { itemWidth: 360, // Optional min width of a grid item autoResize: true, // This will auto-update the layout when the browser window is resized. container: jQuery('#blog-masonrywrap'), // Optional, used for some extra CSS styling offset: 30, // Optional, the distance between grid items flexibleWidth: 360 // Optional, the maximum width of a grid item }; var handler = jQuery('#blog-masonrywrap li'); handler.wookmark(options); } jQuery(window).load(function($) { attWorkGrid_1(); }); jQuery('#blog-masonrywrap li div div a img').load(function() { // Only Change this line if you need to attWorkGrid_1(); });