Home > Web Front-end > JS Tutorial > jQuery toggle() sets CSS style_jquery

jQuery toggle() sets CSS style_jquery

WBOY
Release: 2016-05-16 18:42:18
Original
1413 people have browsed it

toggle()
Toggle the visible state of the element.
If the element is visible, switch to hidden; if the element is hidden, switch to visible.
——————————————————————————————————————————————————————
Example
Toggle the visible state of all paragraphs.
HTML code:

Hello

Hello Again


jQuery code:
$("p" ).toggle()
Result:

Hello

Hello Again


Set a background image to highlight the effect of transparency

Copy code The code is as follows:

< head>
toggle()






Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template