$(“#someDiv").attr("scrollHeight")在jquery-1.6.1中不起作用 [英] $("#someDiv").attr("scrollHeight") not working in jquery-1.6.1

查看:164
本文介绍了$(“#someDiv").attr("scrollHeight")在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆