简体   繁体   English

显示(索引)不适用于 IE8

[英]show(index) not working with IE8

Hey, I have been able to figure out what IE8 hates (show(index)), but not how to fix it.嘿,我已经能够弄清楚 IE8 讨厌什么(显示(索引)),但不知道如何修复它。 I know that what I need to do is having something.show(index), but I'm not sure what.我知道我需要做的是拥有 something.show(index),但我不确定是什么。 Any tips would be awesome.任何提示都会很棒。

var index = 0;
var images = $("#gallery img");
var thumbs = $("#thumbs img");
var imgHeight = $(thumbs).attr("height");
$(thumbs).slice(0,3).clone().appendTo("#thumbs");
for (i=0; i<thumbs.length; i++)
{
    $(thumbs[i]).addClass("thumb-"+i);
    $(images[i]).addClass("image-"+i);
}

$("#next").click(sift);
show(index);
setInterval(sift, 8000);

function sift()
{
    if (index<(thumbs.length-1)){index+=1 ; }
    else {index=0}
    show (index);
}

I think you just need:我想你只需要:

$(thumbs[index]).show();

but I'm not 100% sure because I don't know exactly what your code wants to do.但我不能 100% 确定,因为我不确切知道您的代码想要做什么。

The opposite of ".show()" is ".hide()". “.show()”的反义词是“.hide()”。 You can pass both of those methods arguments to tell them how long to take when showing the element.您可以通过这两种方法 arguments 告诉他们显示元素时需要多长时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM