Javascript / jQuery outerHeight() [英] Javascript/jQuery outerHeight()

查看:130
本文介绍了Javascript / jQuery outerHeight()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$('#idOfLememt')。outerHeight(); 产生相同的结果为所有浏览器?对于IE7有什么不同吗?

Does $('#idOfLememt').outerHeight(); yield same result for all browsers? Any thing different for IE7?

推荐答案

只需转到 http://api.jquery.com/outerHeight/ 与您想要测试和看到自己的不同的浏览器(在Mac OS X所以不能检查IE为您)。

Just go to http://api.jquery.com/outerHeight/ with the different browsers you want to test and see for yourself (on Mac OS X so can't check IE for you). It looks like the DOM in the demo has all possible styles that would affect this included.

大部分时间,您可以依靠jQuery做它的事情,并给你跨浏览器一致的结果,这是它的主要原因之一毕竟。

Most of the time you can rely on jQuery to do it's thing and give you consistent results across browsers, that's one of it's main reasons for being after all.

编辑:当然,如果浏览器混乱了其他东西,例如如果你的容器不是固定的高度和IE渲染的东西你的容器有不同的高度,无论什么原因,那么结果会不同。但是,您可以确保始终获得与屏幕上使用的像素数量相同的结果。

Of course this won't be the case if the browser messes up with something else, for example if your container isn't fixed height and IE renders something inside your container with a different height for whatever reason then the result would be different. You are however pretty much guaranteed to always get the same result as the amount of pixels used on screen.

这篇关于Javascript / jQuery outerHeight()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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