Reputation: 2799
I'm using jQuery tabs, and I currently have a slide effect whenever you click on a tab. My question is: How do you prevent a slide effect from happening on the current active tab if you click it again.
Here is my jQUery:
$(document).ready(function(){
$('#tabs').tabs();
$("#tabs a").click(function() {
$('#tabs p').effect( "slide", "medium" );
});
});
Here is the fiddle:
If you click "Second" and then click "Second" again. It slides into itself. How do you break the effect if you click on the active tab?
Upvotes: 2
Views: 68
Reputation: 10683
use tabs activate
event instread of click
event
$(document).ready(function(){
$('#tabs').tabs({
activate: function(event, ui){
$('#tabs p').effect( "slide", "medium" );
}
});
});
Upvotes: 4