jQuery:nth-child不工作在IE [英] jQuery :nth-child not working in IE
本文介绍了jQuery:nth-child不工作在IE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用此代码
$('.list-item:nth-child(5n)').after('<div class="clear"><img src="http://domain.com/image.jpg" width="780" height="80" alt="banner" /></div>')
这在Firefox和Chrome中可以正常工作,但不能在IE8, 。
This works fine in Firefox and Chrome but not working in IE8, IE9...
推荐答案
jQuery在本机浏览器中处理 nth-child
支持。它在IE7,8和9 +中工作正常。
jQuery handles nth-child
in the absense of native browser support. It works just fine in IE7, 8 and 9+.
小提琴: http://jsfiddle.net/jonathansampson/Y3MP4/
这篇关于jQuery:nth-child不工作在IE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文