Jquery Sliding Method

Jquery slideDown()
This method is used to slide down an element.

Code Structure
$(document).ready(function(){
  $('button').click(function(){
    $('p').slideDown();
  });
}); 


Jquery slideUp()
This method is used to slide up an element.

Code Structure
$(document).ready(function(){
  $('button').click(function(){
    $('p').slideUp();
  });
}); 


Jquery slideToggle()
This method toggles between slideDown() and slideUp().

Code Structure
$(document).ready(function(){
  $('button').click(function(){
    $('p').slideToggle();
  });
}); 


Syntax
$(selector).slideDown(speed,callback);
$(selector).slideUp(speed,callback); 
$(selector).slideToggle(speed,callback);


Code Structure:
$(document).ready(function(){
  $('#hide').click(function(){
    $('p').slideDown(500);
  });
}); 


Code Structure
$(document).ready(function(){
  $('button').click(function(){
    $('p').slideDown(fast);
  });
}); 

Share this

Related Posts