简体   繁体   中英

javascript link makes the page go up onclick

I have a problem in my website, I have build a menu that consist of javascript links, When i click on link from the menu, the page goes up, You can see it here:

http://www.ourevent.co.il/dj-%D7%A1%D7%98%D7%99%D7%91-%D7%9C%D7%95%D7%99-%D7%9E%D7%95%D7%A1%D7%99%D7%A7%D7%94-%D7%95%D7%94%D7%A4%D7%A7%D7%95%D7%AA

I never saw it before, anyone have an idea?

Thanks.

This probably means you have a javascript error somewhere else, or you are using tags with an href of "#" and not using event.preventDefault() in your click method. I would check the console for javascript errors, or ensure your click event is using preventDefault.

ex:

$('a.neat-link').click(function(event){
  event.preventDefault();
  /* do your link stuff here and it should work */ 
})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM