Answers

Question and Answer:

  Home  JQuery Programmer

⟩ Explain slideToggle() effect?

slideToggle() effect is used to give animated sliding effect to an element.

Syntax:

slideToggle([ duration] [, easing] [, callback])

1. "duration" is the number specifying how long the animation will run.

2. "easing" is the string which specify the function for the transition.

3. "callback" is the function which we want to run once the animation is complete.

4. If the element is visible then this effect will slide the element up side and make it completely hidden. If the element is hidden then slideToggle() effect will slide it down side and make it visible.

5. We can specify the toggle speed with this effect.

For example

$("#clickme").click(function()

{

$("#mydiv").slideToggle("slow", function()

{

//run after the animation is complete.

});

});

 171 views

More Questions for you: