link with href=“#” scrolls page to top when used with jquery slidetoggle [duplicate]
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How do I stop a web page from scrolling to the top when a link is clicked that triggers javascript? I'm using jquery's slidetoggle to show/hide divs. the element that controls the sliding is a text link ( some text inside <\a>) which has href="#" so it will look like a link (underline, cursor change). the problem is that when the link is clicked, in addition to the sliding effect, the page scrolls to top. i