By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,826 Members | 2,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,826 IT Pros & Developers. It's quick & easy.

Need Help!

jautrus
P: 3
Hi, i have one big headache...

I need to display a DIV (400px by 300px) in EXACT center (vertical and horizontal) of the browser window in response of some events. Itís not very hard to do this by making the DIV position absolute and calculating and setting its left and top values. Problem arises when user scrolls the page and then DIV is displayed. Now DIV does not account for the scroll.

What I need is a solution to EXACTLY center (horizontally and vertically) a DIV in a browser window whenever it is displayed, regardless of browser window size or screen resolution or the amount of page that has been scrolled. If it keeps its center position even after being displayed and scrolled by the user then it would be much better.

The solution should work at least with IE and Firefox.
Please help me...
i almost lost the hope.... :/

Here is an image with more explonation: http://www.astavo.lt/div.gif
Sep 10 '06 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.