Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Div to appear in the middle of the screen

Status
Not open for further replies.

mattquantic

Programmer
Joined
Mar 28, 2004
Messages
196
Location
GB
Hi. I am trying to get my div layer to appear in the browser window - (including the scroll positions).

I know this is wrong - I just can figure out how to use js vals in the style tag...

<div id="showphoto" style="position:absolute;left:(screen.width/2)px;top:(screen.height/2)px;"><div id="photocontent"></div></div>

Ta if you can help.

M
 
Maybe...

Code:
<script>
[!]document.write('[/!]<div id="showphoto" style="position:absolute;left:[!]'+[/!](screen.width/2)[!]+'[/!]px;top:[!]'+[/!](screen.height/2)[!]+'[/!]px;"><div id="photocontent"></div></div>[!]');[/!]
</script>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
Thanks LFI! - I remember now - it's easy to forget when you switch to other languages after ages.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top