问题描述:

When you click the menu items, the page flickers before it does the animated scrolling. It seems I need to prevent the default href action of the menu items, but I can't find where to do that.

http://teratomic.org/

I can't find 'scrollto' anywhere in the theme code. Heres's what I've found in the theme's Header.php at least... but still can't find where to put the preventdefault

<ul class="navigation">

<?php if (has_nav_menu( 'header-menu' )) { ?>

<?php

$the_menu = array(

'theme_location' => 'header-menu',

'container' => 'ul',

'menu_class' => 'menu',

'echo' => true,

'fallback_cb' => 'wp_page_menu',

'items_wrap' => '%3$s',

'depth' => 0

);

wp_nav_menu( $the_menu );

?>

<?php } ?>

</ul>

网友答案:

If it's a problem with default href behaviour you should in your function before scrollTo place preventDefault so it should look like:

$("yourmenulink").click(function(event) {
event.preventDefault();
scrollTo....

});
相关阅读:
Top