I’m new to jquery, i write a simple snippetto toggle menu . But the problem is : when I scroll at the bot of page and click menu to toggle. It go top unexpectedly .
Thanks for reading .
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You probably have
<a href="#">TEXT</a>as your link, right?href="#"will make the browser scroll up to the top, so add areturn falseon click, so it looks like this:<a href="#" onclick="return false">TEXT</a>; alternatively you can returnfalsefrom your click function to prevent the default behaviour.