In Jquery, the show () and hide () methods are used to show and hide images,

Source: Internet
Author: User

In Jquery, the show () and hide () methods are used to show and hide images,

(1) Function Description

Click "show" link on the page, use the show () method to display an image in an animated manner, and execute a callback function in the method to change the border style of the image; when you click an image that has been displayed, you can use hide () to hide the image in an animated manner.

(2) Implementation Code

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

Animation Mode Display

Usage of jquery hide () and show () Methods

Syntax

$ (Selector). hide (speed, callback)
Speed has three effect parameters • Millisecond (for example, 1500)
• "Slow"
• "Normal"
• "Fast"

When you set the speed, the height, width, margin, padding, and transparency of an element gradually change from visible to hidden.

Example

This is super simple display and hiding. To achieve this, we only need to include 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, we will summarize the display hiding Effect of show and hide.

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

The above content is a small part of Jquery that I will share with you. I hope you will like it.

Related Article

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.