Solve the problem that the image cannot be loaded incorrectly when JS dynamically sets the image SRC of IMG under IE6. In the past two days, a project will be created, and you need to click the thumbnail to display the large image, therefore, JS is used to set the SRC of the big Image Based on the small image. After the design, the problem arises. 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:
The Code is as follows:
Function picclick ()
{
Var pic = $ ('marqueep '). 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.