开发者

Bug in IE with jQuery highlight? Highlighting is sticking on some elements

开发者 https://www.devze.com 2022-12-27 11:58 出处:网络
Is there anything wrong with this line?开发者_如何转开发 $(\'#\' + $(this).attr(\'id\') + \'title\').effect(\"highlight\", {}, 5000).fadeIn(1000);

Is there anything wrong with this line?开发者_如何转开发

$('#' + $(this).attr('id') + 'title').effect("highlight", {}, 5000).fadeIn(1000);

It's being applied to a set of divs in cycles - the first time it shows them, and then as it keeps going round it highlights them again (as they are already shown.)

Only, in IE7 and IE8 the highlight seems to stick on some elements randomly. Anyone know why this is?


If you have any invalid html, IE will tend to do this. Make sure your html is valid by inputting it here: http://validator.w3.org/ and seeing if there are any unclosed tags, improper tags, multiple IDs, etc.

I see this happen most often then a tag isn't closed/matched properly, or when the same ID is used multiple times in the page, fixing the tag or moving to classes for those multiple IDs usually resolves the issue.

0

精彩评论

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