Using JQuery toggle to realize automatic popover of page loading

  • 2020-03-30 02:25:55
  • OfStack

The toggle() event primarily toggles the visible state of the element.

1, toggle (switch) switch is an optional value, if not filled in the original element is shown to hide it, if it is hidden to show.

HTML code:
<p>Hello</p><p style="display: none">Hello Again</p> 

JQuery code:

<p tyle="display: none">Hello</p><p style="display: block">Hello Again</p> 

Switch if there is a value is TRUE or false, if it is TRUE to show the element, false hidden elements.
<p id = "tt">Hello</p> 
<input type="button" value=" transform " id="b"> 

var i = 0; 

2. Toggle (speed, [callback]) speed is an optional parameter, which represents the speed of element animation. [callback] is a method that a function can execute.

The HTML code
<p style="display: none" id = "t">Hello Again</p> 

JQuery code

That is, when using the second method, hidden speed can be used to load the page automatically pop-up screen

Related articles: