var didScroll; var lastScrollTop = 0; var delta = 5; var navbarHeight; var timeToClose; jQuery(document).ready(function($){ if ( $('#main').hasClass('disable-top-menu') ){ jQuery('.megamenu.main-megamenu-id').remove(); } $('.showOrHide .showOrHide__trigger').on('click', function(e) { e.preventDefault() var parent = $(this).parents('.showOrHide') if($(this).is('a') ) { if(parent.hasClass('visible')) { parent.removeClass('visible') } else { parent.addClass('visible') } } }) $(document).on('click', function(e) { var cont = $('.showOrHide') if (!cont.is(e.target) && cont.has(e.target).length === 0) { cont.removeClass('visible') } }) if(module == 'cart' || module == 'register') { $('#register_bt').on('click', function(){ setTimeout(function(){ var err = $('#register_form').find('.alert_fValidator'); if(err.length > 0) { $('html, body').animate({ scrollTop: err.first().offset().top - 30 }, 250); } },200); }) } if(module == 'advanced_search') { $('#content input[type=text]').on('keyup',function(e){ var code = e.keyCode || e.which; if(code == 13) { jQuery('#fas').submit(); } }); } $('#header_wishlist.wishlist').mouseover(function () { clearInterval(timeToClose); $('#header_wishlist .cart-preview').fadeIn(0); if ($('#header_wishlist .cart-preview').html().length == 0) { $.post("/ajax/cart/ajax_cart_box/", {"json": true, "type": "wishlist"}, function (data) { var res = '
'; res += '' + def.index.cart_empty + '