JQuerytoggle use analysis _ jquery

Source: Internet
Author: User
Today, I am talking about the toggle in JQuery. The article involves some problems. I hope you can help me solve them. Today we will focus on a toggle (fn, fn ,....) A function is mainly used to switch the rotation operation of an event.
For example, for a button click event and a DIV background, click a button once to display the DIV background in blue.
Change the background color to black.
The HTML code we define is as follows:


The id "DivToggle" is displayed here.



The initial style is defined as follows:

The Code is as follows:


# DivToggle {
Height: 150px;
Width: 200px;
Margin: 50px;
Background-color: # 6CC;
}



In toggle (fn, fn ,....); A toggle () function is used to switch the display status of an element. If an element is displayed, it is hidden after. toggle () is called.

JQuery code:

The Code is as follows:


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.