开发者

jquery: inner: outerHeight

That I got no idea how. I need a function that the window height or the monitor开发者_运维百科 configuration is larger than 1200, put a div position top = 1000px and else put in another position top = 800px


Try the following: http://jsbin.com/igoxu3/edit

(And while this is not the most consolidated code, I thought breaking it out would be good for illustration.)


Like this:

if ($(window).height() > 1200) {
   el.css('top', 1000);
} else {
   el.css('top', 800);
}

Improved version, should work in IE:

if ((window.innerHeight||document.body.clientHeight) > 1200) {
   el.css('top', 1000);
} else {
   el.css('top', 800);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜