Asp. NET Dynamic website production (one)-JQ (3)

Source: Internet
Author: User

This lesson is mainly about CSS work, and then continue to talk about jquery.

content :

1.CSS homework explanation.

2.JQ set element style:

(1) Add, remove CSS Category: $ ("div"). addclass ("MyClass1 myClass2"); $ ("div"). Removeclass ("MyClass1");

(2) Dynamic switching between classes:

1 $ (function() {2     $ ("P"). Click (function() {3         $ (this). Toggleclass ("highlight"); // Keep switching when you click 4     }); 5 });

Description: Toggleclass can only set one class and cannot set multiple.

(3) Direct access, set style:

1 $ ("P"). MouseOver (function() {2     $ (this). CSS ("Color", "Red") ; 3 }); 4 5 $ ("P"). Mouseout (function() {6     $ (this). CSS ("Color", "Black"); 7 });

MouseOver () indicates that after the mouse is moved up, Mouseout () indicates that the mouse has moved.

Hover (function () {$ ("D1"). Hide (+)},function () {$ ("D1"). Show (1000)}), two function means after the mouse is moved and the mouse is removed, Can replace the above mouseover () and Mouseout ().

Toggle () is to show and hide alternating executions.

PostScript : Next class continue to talk, review, preview, practice.

Asp. NET Dynamic website production (one)-JQ (3)

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.