tags:

views:

43

answers:

2

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

+1  A: 

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);
}
edwin
work fine in FF and Safary, but don't work in IE.
Mango
+1  A: 

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.)

Lance May