How do I stop a localScroll event firing
I have localScroll
initialised with the following settings:
// Local scroll settings
$.localScroll({
event:'click',
axis:'y',
duration:500,
o开发者_如何学JAVAffset:-30,
hash:true,
stop:true
});
That's fine as an all-purpose setup but I also have some links with hrefs that match the above for which I don't want localScroll
to fire. Here's an excerpt:
<ul class="line tabs">
<li class="unit"><a href="#foo" class="active">Foo</a></li>
I have a click event handler that runs a custom function on the 4 links of this type:
$('.home .tabs a').click(activate_tab);
The activate_tab
function includes:
return false;
but I've realised that localScroll
is firing and overriding that.
How can I stop localScroll from firing on these specific click events?
If you have no other events bound to the click on those links, you can do
$('.home .tabs a').unbind('click').click(activate_tab);
精彩评论