Saturday, 26 March 2016

How to use jQuery Sliding effects - slideDown, slideUp, slideToggle ?


Creates a sliding effect on elements.
Sliding methods are : slideDown, slideUp, slideToggle

slideDown()

Slides down an element.
SYNTAX
$(selector).slideDown(speed,callback);

Example
$("#flip").click(function() {
 $("#panel").slideDown();
});


slideUp()

Slides up an element.
SYNTAX
$(selector).slideUp(speed,callback);

Example
$("#flip").click(function(){
  $("#panel").slideUp();
});


slideToggle()

Toggles between the slideDown() and slideUp() methods.
If the elements have been slid down, slideToggle() will slide them up.
If the elements have been slid up, slideToggle() will slide them down.

SYNTAX
$(selector).slideToggle(speed,callback);

Example
$("#flip").click(function(){
 $("#panel").slideToggle();
});

No comments:

Post a Comment

Note: only a member of this blog may post a comment.