Every menu item we click will load the page. After that the menu link is prepend with #top
This is a not wanted feature how can this be removed/ adjusted?
This prevents reloading the same page after a new click but thats is just what we want to happen in our case.
Regards,
Aren
Hey Aren,
Thanks for contacting us!
Please copy enfold/js/avia.js to your child theme inside /js/ folder, open the file and find following line
matching_link = this.$body.find(this.selector + "[href='"+current+"']").attr('href',current+'#top');
and comment it out as following
// matching_link = this.$body.find(this.selector + "[href='"+current+"']").attr('href',current+'#top');
Then add following code to functions.php file of your child theme
function wp_change_aviajs() {
wp_dequeue_script( 'avia-default' );
wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/avia.js', array('jquery'), 2, true );
}
add_action( 'wp_print_scripts', 'wp_change_aviajs', 100 );
Best regards,
Yigit
Ok thanks.
I had to change the two lines where matching_link a part from is to:
var current = window.location.href;
And then it worked.
Thanks,
Aren