-
DIV dynamic positioning
Hi, I've been having trouble trying to dynamically position DIV layers on
the page.
Let's say I want to place the layer the (screen height) / 2 down the screen.
So if my screen res is 640x480, it will place the layer object at 240 pixels
down the screen, and if the screen res is 800x600, it will place the layer
300 pixels down the screen.
Getting screen res is no problem. Doing dynamic positioning is what is bothering
me
What I did at first (but it didn't work) was I made a javascript init() function
that takes the DIV ID and adjusts the height, and this would be run when
the page loads. However, this didn't work, as nothing was set in the correct
position at all. There was another method which involved using the document.writeout
function, but I don't want to use any document.writeOut functions either.
So can anyone give me advice on this? Thanks
-
Re: DIV dynamic positioning
Tables?
being able to control the cells, thier height and width and where data appears
in them might solve your problem.
"P-Dog" <project_gayo_history@hotmail.com> wrote:
>
>Hi, I've been having trouble trying to dynamically position DIV layers on
>the page.
>
>Let's say I want to place the layer the (screen height) / 2 down the screen.
> So if my screen res is 640x480, it will place the layer object at 240 pixels
>down the screen, and if the screen res is 800x600, it will place the layer
>300 pixels down the screen.
>
>Getting screen res is no problem. Doing dynamic positioning is what is
bothering
>me
>
>What I did at first (but it didn't work) was I made a javascript init()
function
>that takes the DIV ID and adjusts the height, and this would be run when
>the page loads. However, this didn't work, as nothing was set in the correct
>position at all. There was another method which involved using the document.writeout
>function, but I don't want to use any document.writeOut functions either.
> So can anyone give me advice on this? Thanks
-
Re: DIV dynamic positioning
Hi,
How do you captured the display resolution ??
Thank you,
Herries
"P-Dog" <project_gayo_history@hotmail.com> wrote:
>
>Hi, I've been having trouble trying to dynamically position DIV layers on
>the page.
>
>Let's say I want to place the layer the (screen height) / 2 down the screen.
> So if my screen res is 640x480, it will place the layer object at 240 pixels
>down the screen, and if the screen res is 800x600, it will place the layer
>300 pixels down the screen.
>
>Getting screen res is no problem. Doing dynamic positioning is what is
bothering
>me
>
>What I did at first (but it didn't work) was I made a javascript init()
function
>that takes the DIV ID and adjusts the height, and this would be run when
>the page loads. However, this didn't work, as nothing was set in the correct
>position at all. There was another method which involved using the document.writeout
>function, but I don't want to use any document.writeOut functions either.
> So can anyone give me advice on this? Thanks
-
Re: DIV dynamic positioning
In these cases I wouldn't I'd use %'s for position, that way it adjusts when
the user has different resolutions.
"Herries" <herries_e@yahoo.com> wrote:
>
>Hi,
>
>How do you captured the display resolution ??
>
>Thank you,
>
>Herries
>
>"P-Dog" <project_gayo_history@hotmail.com> wrote:
>>
>>Hi, I've been having trouble trying to dynamically position DIV layers
on
>>the page.
>>
>>Let's say I want to place the layer the (screen height) / 2 down the screen.
>> So if my screen res is 640x480, it will place the layer object at 240
pixels
>>down the screen, and if the screen res is 800x600, it will place the layer
>>300 pixels down the screen.
>>
>>Getting screen res is no problem. Doing dynamic positioning is what is
>bothering
>>me
>>
>>What I did at first (but it didn't work) was I made a javascript init()
>function
>>that takes the DIV ID and adjusts the height, and this would be run when
>>the page loads. However, this didn't work, as nothing was set in the correct
>>position at all. There was another method which involved using the document.writeout
>>function, but I don't want to use any document.writeOut functions either.
>> So can anyone give me advice on this? Thanks
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks