farhang
farhang

Reputation: 407

jquery (reverse) speed on toggled class (jsfiddle ex)

I have a quick question about jquery's toggle speed that I cannot implement in this particular case:

My question:

How could I implement in my code something that would make the second click also go slower and not so abruptly?

Here is the fiddle.

$(document).ready(function() {
    $('#side').hide()
}),
$("#btn").click(function() {
    $('#main').toggleClass('two-thirds');
    $("#side").toggle(1000);
});

Upvotes: 0

Views: 52

Answers (1)

S. Walker
S. Walker

Reputation: 2162

You could use .animate() or CSS3 Transitions, depending on your client base.

Jquery .animate() http://api.jquery.com/animate/

CSS3 Transitions: http://www.w3schools.com/css/css3_transitions.asp

Upvotes: 1

Related Questions