Closed Thread Icon

Topic awaiting preservation: Screen size - background image (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8503" title="Pages that link to Topic awaiting preservation: Screen size - background image (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Screen size - background image <span class="small">(Page 1 of 1)</span>\

 
Eric001
Bipolar (III) Inmate

From: Chicago
Insane since: Jan 2003

posted posted 01-30-2003 06:09

Hi again,

Im also wondering if anyone knows of a script or would be willing to help create a script that will do the following:

Detect screen size
select the correct background image depending on screen size
the background image has to be fixed.

I madee some webpages that look great when the screen resolution is 800x600. But the background image doesnt fit and looks aweful when someone has a screen resolution of 1024x768

thanks much,

Eric

Hugh
Paranoid (IV) Inmate

From: Dublin, Ireland
Insane since: Jul 2000

posted posted 02-01-2003 21:44

Give it a go yourself first. You'll find it isnt too hard. And also Im sure Ive seen this simple script in those resource type places. The screen size is gotten with screen.width and screen.height (Very compatable) and then the background image can be set in IE and newer browsers Im sure.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 02-01-2003 21:56

screen.width and screen.height can't be relied on for getting the browser's size. They get the *screen's* width and height, which only corresponds to the browser if it's maximized (which is not a safe assumption).

Rather, use

(for mozilla)
window.innerWidth
window.innerHeight

(for ie)
document.body.clientWidth
document.body.clientHeight

the IE stuff only works reliably if you use CSS to make sure the body spans the entire page.

« BackwardsOnwards »

Show Forum Drop Down Menu