How jquery modifies the style under Li, and modifies the value of the IMG under Li's src, below is the specific implementation code that needs a friend to see
$ (". Test Li"). Click (function () {
$ (". Test Li a"). Removeclass ("test01");
$ (". Test Li a"). AddClass ("test02");
$ ("a", this). Removeclass ("test02");//A label in current Li
$ ("a", this). AddClass ("test01");
var Title_index = $ (this). Index ()//
all img
var allimg = $ (". Test li img")
in the index//li of the current Li; for (var i = 0; i < allimg.size (); i++) {
if (i% 2 = 0) {
$ (allimg[i]). attr ("src", "images/b04.gif"); Change im G's SRC
} else {
$ (allimg[i]). attr ("src", "images/b05.gif");
}
The current img
var IMGs = $ ("img", this) in Li;
for (var i = 0; i < imgs.size (); i++) {
if (i = = 0) {
$ (imgs[i]). attr ("src", "images/b01.gif");
{
$ (imgs[i]). attr ("src", "images/b02.gif");
}
if (Title_index = = 0) {
$ ("#a). Hide ();
$ ("#b"). Show ();
else {
$ (' #b '). Hide ();
$ ("#a"). Show ();
}
}