In the past two days, I caught up with a project and asked to click the thumbnail to display the big image. So I used JS to set the SRC of the big image. After the design, the problem came out. In IE6, the large image cannot be displayed. You can right-click the image to display the link address. IE7, IE8, and FF have no such problems. The Code is as follows:
Copy codeThe Code is as follows:
Function picclick ()
{
Var pic = $ ('marqueediv '). getElementsByTagName ('A ');
Var len = pic. length;
For (var I = 0; I <len; I ++)
{
Pic [I]. onclick = function (I)
{
Return function ()
{
For (var t = 0; t <len; t ++)
{
Pic [t]. className = t = I? 'Hover ':'';
This. className = 'hover'
}
Var thispic;
Sspic = pic [I]. childNodes [0]. src;
Thispic = 'uploadimg/'+ sspic. substring (sspic. indexOf ('uploadimg/s'), sspic. length). replace ('uploadimg/s ','');
$ ('Pro _ pic_item '). setAttribute ('src', thispic );
$ ('Pro _ pic_item '). setAttribute ('alt', 'images ');
// Solution: Add "return false;" here ;"
Return false;
}
}
(I)
}
}
According to Internet knowledge, this is a problem of the underlying judgment factors of ie6.