开发者

Javascript cycled content disappearing in IE

I have cycling content on the websites section of my website. In Internet Explorer the link for the website disappears after being shown once. It seems to work fine开发者_如何学编程 in other browsers.

Here is a link: http://beta.crimmer.co.uk/

Why is this happening?


I looked at your page in the IE debugger and all I could determine was that the link and the text are there and are rotating as desired, but the missing link has zero height so it does not display. I was not able to figure out why. I wondered if it had to do with the age old "IE needs layout" issue which is sometimes fixed with CSS of zoom: 1; but I don't if that's it or not.

I did also notice that both your link objects link1 and link2 have the same id. That's probably not a good idea though probably not what is causing this particular issue. I don't see anywhere in your code where you refer to that id value so you can perhaps replace it with a class name and use that for any formatting.

FYI, it shows initially because it's in the HTML for the initial page. It's obviously something you're doing with the prorammatic rotation that IE doesn't like, thus it never shows when you insert it programmatically.

One possible work-around since the HTML for link1 and link2 is known ahead of time and which would also reduce your code would be to just construct the HTML string for link1 and link2 and rather than rotating manually created objects, just set the innerHTML and let the browser create everything for you with:

document.getElementById('websiteText').innerHTML = link1HTML;

or

document.getElementById('websiteText').innerHTML = link2HTML;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜