Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
125
rated 0 times [  128] [ 3]  / answers: 1 / hits: 147443  / 15 Years ago, thu, august 13, 2009, 12:00:00

In order to better balance out a page I am working on I would like to find a way to increase the top margin of a DIV depending on the screen resolution. What is my best way to set these dimensions with jQuery or Javascript?


More From » jquery

 Answers
21

To get screen resolution in JS use screen object



screen.height;
screen.width;


Based on that values you can calculate your margin to whatever suits you.


[#98923] Sunday, August 9, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
arron

Total Points: 663
Total Questions: 119
Total Answers: 112

Location: Belize
Member since Mon, Jun 20, 2022
2 Years ago
;