Go Back   Dreamweaver Club Forums > Dreamweaver forums > Dreamweaver General
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 03-15-2006, 09:13 AM   #1
Join Date: Aug 2005
Posts: 115
Default 'If' and 'then' statements and screen size.

'If' and 'then' statements and screen size.


Hi there, I have a screen size resolution problem.

Is it at all possible for an 'if' statement to be created that will change the pictures viewed depending on the screen size?


If screen size = 800x600 then view this.

<div align="left">[img]images/Productsa.gif[/img]</div>

If screen size = 1024x768 then view this.
<div align="left">[img]images/Productsc.gif[/img]</div>

Please use code tags when posting code
malhyp is offline   Reply With Quote
Old 03-15-2006, 10:58 AM   #2
davidj's Avatar
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256


javascript has width and height methods

here is a function i wrote to position some nav layer buttons depending on screen res

ht & wt are hidden fileds (ht = height, wt =width)
when fired the function checks the rez and populates the hidden fields with numerics like 800, 600

function screenres(){
	document.getElementById('ht').value = screen.Height;
	document.getElementById('wt').value = screen.Width;
You can then use these values to decide what to do next
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 03-15-2006, 04:16 PM   #3
domedia's Avatar
Join Date: Dec 2003
Posts: 9,730

Also try Cameron's (the man in blue) script on how to change design based on resolution.
I just met him at SXSW, great guy and co-author of Sitepoint's latest DOM scripting book.
domedia is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:31 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com