$(“#someDiv").attr("scrollHeight")在jquery-1.6.1中不起作用 [英] $("#someDiv").attr("scrollHeight") not working in jquery-1.6.1
问题描述
$("#someDiv").attr("scrollHeight")
在所有浏览器的jQuery 1.3.2 中均有效.但是在更新到jQuery 1.6.1 时,它仅在IE9中有效.
Firefox 4.0.1,Google Chrome 11和Safari 5均返回undefined.
$("#someDiv").get(0).scrollHeight
但是仍然适用于所有浏览器.
$("#someDiv").attr("scrollHeight")
works in jquery 1.3.2 for all browsers. But on updating to jquery 1.6.1, it only works in IE9.
Firefox 4.0.1, Google Chrome 11 and Safari 5 all return undefined.
$("#someDiv").get(0).scrollHeight
however still works for all browsers.
任何人都知道发生了什么吗?最新的jquery(即1.6.1版)中的 attr("scrollHeight")
被破坏了吗?
Anybody knows what is going on?, is attr("scrollHeight")
broken in the newest jquery (i.e version 1.6.1)?
推荐答案
jQuery 1.6引入了.prop
并更改了.attr
的含义.
jQuery 1.6 introduced .prop
and changed the meaning of .attr
.
(总是值得首先检查文档; .attr
的页面也对此进行了讨论.)
这篇关于$(“#someDiv").attr("scrollHeight")在jquery-1.6.1中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!