Use the show () and Hide () methods in jquery to animate and hide pictures _jquery

Source: Internet
Author: User

(1) Functional description

In the page, click the Show connection, animate a picture by showing the display () method, and execute a callback function in the method to change the border style of the picture, and when you click the displayed picture, the picture is animated by using hide ().

(2) Implementation code

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
 
 

Animation way Slowly show

jquery Hide (), show () method usage detailed

Grammar

$ (selector). Hide (Speed,callback)
Speed with three effect parameters • milliseconds (e.g. 1500)
• "Slow"
• "Normal"
• "Fast"

In the case of setting the speed, the element will gradually change its height, width, outer margin, inner margin, and transparency as it is visible to the hidden process.

Cases

 
 

This is a super simple display and hidden, if you want to have the effect we just have time or parameters in hide or show

<script type= "Text/javascript" >
$ (document). Ready (function () {
 $ (". Btn1"). Click (function () {
 $ ( "P"). Hide (1000);
 $ (". Btn2"). Click (function () {
 $ ("P"). Show (1000);
 }
); </script>

Finally, it summarizes the display hiding effect of a show,hide implementation

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">  

The above is a small compilation to share with you in jquery use Show () and Hide () methods to animate and hide pictures, I hope you like.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.