Using jquery toggle to implement Web page loading complete automatic window

Source: Internet
Author: User

 toggle () event It mainly toggles the visible state of the element, here is a introduction to the use of jquery toggle implementation of the Web page loading completed automatic window

Toggle () Event It mainly toggles the visible state of the element.     1, toggle (switch) ①switch is an optional value, if not filled, the original element is displayed to hide it, if it is hidden display.     HTML code:    code as follows: <p>hello</p><p style= "Display:none" >hello again</p>& nbsp   JQuery Code:    code is as follows: $ ("P"). Toggle ()     Results:  code is as follows: <p tyle= "Display:none" >Hello< /p><p style= "Display:block" >hello again</p>   ②switch If a value is true or FALSE, the element is displayed if it is true. False to hide elements.   html  code as follows: <p ID = "tt" >Hello</p>  <input type= "button" value= "transform" id= "B" >  &nbs P The jquery  code is as follows: var i = 0;  $ ("#b"). Click (function () {  $ ("#tt"). Toggle (i++%2==0); });    2, Toggle (speed, [callback]) speed is an optional parameter that represents the speed of the animation of the element, which is displayed or hidden by the "slide" of the animation, and its value can be made (slow, normal, fast); [Callback] Is the method that the function can execute.     HTML code   code as follows: <p style= "display:none" id = "T" >hello again</p>    jquery code   The code is as follows: $ ("#t"). Toggle ("Slow", function () {  alert ("123456 "); });    that is: When using the second method, the hidden speed can be loaded on the Web page automatically screen    

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.