jquery选择器不在IE中工作

时间:2010-07-01 15:37:26

标签: javascript jquery jquery-selectors

这两个选择器在Internet Explorer 8中不起作用(它们在Firefox,Safari和Chrome中都可以正常工作)。

$(this.children).stop().animate({ color: "#4B2B26" }, 300);
$(this).find('a').stop().animate({ color: "#4B2B26" }, 300);

感谢帮助,谢谢!

编辑;我认为这是jquery.js的一个问题..每次我徘徊一个对象,调试器都会拖出来; “无效参数,Jquery.js第137行代码0”。

现在我有;

$("a", this).stop().animate({ 'color': '#CEEAE6' }, 300); 

也不在IE中工作。

但这个在IE中工作正常;

$("h3", this).stop().animate({ 'border-bottom': '5px solid #CEEAE6' }, 0);

1 个答案:

答案 0 :(得分:1)

不知道第二条规则,但对于第一条规则,你可以试试这个:

$(this).children().stop().animate({ color: "#4B2B26" }, 300);

.children()是一个jQuery方法,因此与浏览器无关。 “this.children”返回当时“this”的子属性。不知道这是否甚至是IE中DOM元素的受支持属性。使用“this.childNodes”也可以在这里做到,但可能也不是浏览器独立...

相关问题