0
Q:

jquery show hide

//$(selector).hide(speed,easing,callback)

$('#yourElement').hide(); //this works just fine
$('#yourElement').hide(1000); //hides in 1 second
$('#yourElement').hide(1000, 'swing'); //valid values are swing or linear
$('#yourElement').hide(1000, 'linear', yourFunctionHere()); //same as above but with a callback to a custom function
$('#yourElement').hide(1000, 'linear', function() {
	//you can even do this to just write a one-time function inline if necessary
});
11

$("#hide").click(function(){
  $("p").hide();
});

$("#show").click(function(){
  $("p").show();
}); 
4
<div id="main"> 
  <p> Hide/show this div </p>
</div>

('#main').hide(); //to hide

// 2nd way, by injecting css using jquery
$("#main").css("display", "none");
1

$("#hide").click(function(){

  $("p").hide();

});



$("#show").click(function(){

  $("p").show();

}); 
0

  $(document).ready(function() {
    $("#btnshow").click(function() {
      $("#imgshow").slideToggle();
    });
  })
0

New to Communities?

Join the community