I have a list of menus:
<ul>
<li><a href="#about" id="about">ՄԵՐ ՄԱՍԻՆ</a></li>
<li><a href="#products" id="products" >ԱՐՏԱԴՐԱՆՔ</a></li>
<li><a href="#farm" id="farm" >ՏՆՏԵՍՈՒԹՅՈՒՆ</a></li>
<li><a href="#gallery" id="gallery" >ՆԿԱՐՆԵՐ</a></li>
<li><a href="#contacts" id="contacts">ՀԵՏԱԴԱՐՁ ԿԱՊ</a></li>
</ul>
and I use the address plugin to have back/forward along ajax, but I have a little bug that I'm not able to fix.
When I click on the menu, if the page has scrolling, it moves the page until the menu appears in the top of page, but I don't need it do that.
Is there a method to disable this behavior?
Thanks a lot.
Create or modify the click()
handlers for the links to use the preventDefault()
method.
For example:
$("a").click
(
function (evt)
{
//YOUR CODE HERE
evt.preventDefault();
return false;
}
);
try adding the following to your links:
onclick="return false;"
Since you are probably adding an event handler to this link for the click event. Just add the return false to the end of it rather than directly on the HTML tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With