$ (". Test Li"). Click (function () {
$ (". Test Li a"). Removeclass ("test01");
$ (". Test Li a"). AddClass ("test02");
$ ("a", this). Removeclass ("test02");//a tag in the current Li
$ ("a", this). AddClass ("test01");
var Title_index = $ (this). index ();//Current Li's index
All of the IMG in Li
var allimg = $ (". Test li img");
for (var i = 0; i < allimg.size (); i++) {
if (i% 2 = = 0) {
$ (Allimg[i]). attr ("src", "images/b04.gif");//change img SRC
} else {
$ (Allimg[i]). attr ("src", "images/b05.gif");
}
}
IMG In the current Li
var IMGs = $ ("img", this);
for (var i = 0; i < imgs.size (); i++) {
if (i = = 0) {
$ (imgs[i]). attr ("src", "images/b01.gif");
} else {
$ (imgs[i]). attr ("src", "images/b02.gif");
}
}
if (Title_index = = 0) {
$ ("#a). Hide ();
$ ("#b"). Show ();
} else {
$ ("#b"). Hide ();
$ ("#a"). Show ();
}
})
jquery modifies the style under Li and modifies the SRC value of the img under Li