;(function($, window, document, undefined) { var $win = $(window); var $doc = $(document); $doc.ready(function() { $('.header .menu-btn').on('click', function () { $('.header .nav, .header .nav-secondary').stop(true, true).slideToggle(); return false; }); var ww = $win.width(); if (ww < 960) { $('.header nav>ul>li>a').on('click', function() { $('.dropdown').stop(true, true).slideUp(200); if ($(this).parent('li').hasClass('clicked') ) { return true } else { $(this).parent('li').find('.dropdown').stop(true, true).slideToggle(200); $(this).parent('li').addClass('clicked'); return false; } }); }; $win.load(function () { var carousel = $(".slider .slides"); carousel.carouFredSel({ onCreate: function () { $win.on('resize', function () { carousel.parent().add(carousel).height(carousel.children().first().height()); }).trigger('resize'); }, auto: true, width: '100%', responsive: 'true', duration: 6000, items : { start : 0 }, pagination : { container : ".slider-nav ul", anchorBuilder : false }, scroll : { duration : 1000, pauseOnHover : true } }); }) }); })(jQuery, window, document);