Home  >  Article  >  Web Front-end  >  There are several effects of JQuery Show(). There is always one you need.

There are several effects of JQuery Show(). There is always one you need.

巴扎黑
巴扎黑Original
2017-06-29 10:42:511295browse

1 show() method and hide() method


$("selector"). show()
Restore the element's default or set display attribute from display:none
$("selector").hide()
Set the display style of the element to none, which is equal to $("selector").css("display","none")
(Note: After passing in the parameters, .show() and .hide The () method animation changes the width, height and transparent properties of the element at the same time; the passed-in parameter controls the display and hide speed, in milliseconds, such as .show(600), you can also pass in fast , normal, slow, fast is 200 milliseconds, normal is 400 milliseconds, slow is 600 milliseconds)


2 fadeIn() method and fadeOut() method


$("selector").fadeIn()
Control the transparency to increase from display:none to fully displayed within the specified time
$ ("selector").fadeOut()
Controls the transparency to be reduced to display:none within the specified time;


##3 slideUp() method and slideDown( )Method


$("selector").slideUp() Controls the height of the element to shorten from bottom to top to display within the specified time :none;

$("selector").slideDown() Control the height of the element to extend from display:none to the full height within the specified time


4 Custom animation method animate()

##$("selector").animate(params,speed,callback);
params: a mapping containing style attributes and values, such as {property1: "value1", property2: "value2",...} speed: speed parameter, optional
callback: when the animation is completed Parameters to be executed when executed (i.e.
Callback function
), optional

The above is the detailed content of There are several effects of JQuery Show(). There is always one you need.. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn