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)