Reputation: 1404
I have my table with toggles on click. I would need to apply the fade in and fade out when i click on fondos or sociedades. Now it's not so smooth. How can i achieve it?
Upvotes: 1
Views: 116
Reputation: 22241
Simple. Replace .toggle()
with .fadeToggle()
.
$(".fondos").on('click', function() {
$("tbody .f").fadeToggle();
});
$(".sociedades").on('click', function() {
$("tbody .s").fadeToggle();
});
Demo: http://jsfiddle.net/iambriansreed/SPV63/1/
Upvotes: 1
Reputation: 191749
You can simply add the time to animate the toggle as arguments (a number like 500
or the 'slow'
and 'fast'
strings. .toggle
has 0 animation time by default like .show
and .hide
.
http://jsfiddle.net/hAv7P/23/ -- that better?
Upvotes: 1