jQuery Mobile Drop Down Menu Causing Page Reload

2019-08-19 00:08发布

I have a drop down menu on this development Wordpress site: http://zap2dev.redzephyr.biz/ the mobile menu appears to be working fine however upon pressing the mobile menu icon the menu displays and promptly the page begins reloading. Obviously on reload the mobile menu is collapsed again so begins the vicious cycle.

Any ideas what could be causing the page to reload?

Any help would be greatly appreciated.

2条回答
Juvenile、少年°
2楼-- · 2019-08-19 00:19

Change <a class="navicon mtoggle" href=""> to <div class="navicon mtoggle"> then update your css

nav#mobile .navicon{
cursor:pointer;
}
查看更多
时光不老,我们不散
3楼-- · 2019-08-19 00:34

Try making your toggle not a link and instead a div. Otherwise with javascript assign on click or touch to prevent.default which would cause the browser from trying to open the link which doesn't have an assigned href and reloads the page.

查看更多
登录 后发表回答