这两个选择器在 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);
最佳答案
不知道第二条规则,但对于第一条规则,你可以尝试这个:
$(this).children().stop().animate({ color: "#4B2B26" }, 300);
.children() 是一个 jQuery 方法,因此与浏览器无关。 “this.children”返回当时“this”的子属性。不知道这是否是 IE 中 DOM 元素支持的属性。使用“this.childNodes”也可能在这里起作用,但可能也不独立于浏览器......
关于javascript - jquery 选择器在 IE 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3159324/