You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
cosmopet.ae/wp-content/themes/woodmart22/js/scripts/menu/onePageMenu.min.js

1 lines
1.2 KiB

!function(a){woodmartThemeModule.onePageMenu=function(){var b=function(b){var d=a("#"+b+', .wd-menu-anchor[data-id="'+b+'"]');if(!(d.length<1)){var e=d.offset().top;a("html, body").animate({scrollTop:e-woodmart_settings.one_page_menu_offset},800),setTimeout(function(){c(b)},800)}},c=function(b){var c;a(".onepage-link").each(function(){var d=a(this);(c=d.find("> a").attr("href").split("#")[1])===b&&(a(".onepage-link").removeClass("current-menu-item"),d.addClass("current-menu-item"))})};if(woodmartThemeModule.$body.on("click",".onepage-link > a",function(c){var d=a(this),e=d.attr("href").split("#")[1];a("#"+e).length<1&&a('.wd-menu-anchor[data-id="'+e+'"]').length<1||(c.preventDefault(),b(e),a(".wd-close-side").trigger("click"),a(".wd-fs-close").trigger("click"))}),a(".onepage-link").length>0){a(".entry-content > .vc_section, .entry-content > .vc_row").waypoint(function(){var b=a(a(this)[0].element),d=b.attr("id");c(d)},{offset:150}),a(".wd-menu-anchor").waypoint(function(){c(a(a(this)[0].element).data("id"))},{offset:function(){return a(a(this)[0].element).data("offset")}});var d=window.location.hash.split("#")[1];window.location.hash.length>1&&setTimeout(function(){b(d)},500)}},a(document).ready(function(){woodmartThemeModule.onePageMenu()})}(jQuery);