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(); } var header_top_elements = ['.languages .language-link'] $.each(header_top_elements, function(key, value) { $(value).on('click', function(e) { e.preventDefault() var parent = $(this).parent() if($(this).is('a') || $(this).is('img')) { if(parent.hasClass('visible')) { parent.removeClass('visible') } else { parent.addClass('visible') } } }) }) $(document).on('click', function(e) { var cont = ['.languages'] $.each(cont, function(key, value) { value = $(value) if (!value.is(e.target) && value.has(e.target).length === 0) { value.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 + '