Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: background images and the browser window  (Read 4346 times)

0 Members and 1 Guest are viewing this topic.

Brock Jackson

  • Guest
background images and the browser window
« on: December 16, 2004, 01:25:48 AM »
i was wondering if there is any way to get the window dimensions right as someone opens a window. maybe not, but i thought maybe i could use the
Code: [Select]
<body background="/bg.jpg" bgproperties="fixed" width="+width_of_window+" height="+height_of_window+"> so that the background picture will fill up the background without having to repeat it.
and if theres a way to achieve this affect, please let me know

Corrosive

  • Guest
Re: background images and the browser window
« Reply #1 on: December 16, 2004, 12:56:36 PM »
Yes, you get Javascripts to do such a task (normally it's in the guise of a screen resolution detector) but I'm not liking you're plan of action.

Personally, I wouldn't do it because it sounds like a very tacky effect (unless you can somehow pull it off, which -no offence - is not likely). But if I did want to do it, I'd get a few background images to cope with the different resolutions, and use a bit of javascript or another scripting language to pick the appropriate file.

But that's just me. This site offers a script you might like (you may need to adapt it slightly):
http://www.pageresource.com/jscript/jscreen.htm

Alternatively, you could use CSS to centre the background image. Obviously you'll have the white background showing through at the edges but if it doesn't affect your design too much...

MMaverick

  • Guest
Re: background images and the browser window
« Reply #2 on: January 15, 2005, 04:54:45 AM »
I wouldn't do that - to much work. What I would suggest is to make a new <DIV style="position:absolute"> layer which you make 100% wide and tall. Then put the picture in it <IMG> also 100% wide and tall. Finally you need to put the <DIV> layer to the background by setting the z-order to -1.

That's it. Works in IE, dunno about other browsers

I have this done in my website: http://bots.sscentral.com/mav
« Last Edit: January 15, 2005, 04:55:24 AM by MMaverick »

Flame

  • Moderator


  • Prodigy

  • Think, dream, see, be... Everything.
  • Thanked: 6
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Other
Re: background images and the browser window
« Reply #3 on: January 15, 2005, 08:15:48 PM »
Read the post that you made on the other board..... It can't be possible...

[glb]Flame[/glb]

Corrosive

  • Guest
Re: background images and the browser window
« Reply #4 on: January 16, 2005, 12:20:01 PM »
Actually Flame, I think BJ (If that's your real name, I sure feel sorry for you - you must have suffered years of torment in school for those initials ;) ) wants to get the screen resolution so that he can get a background picture - stored on the server locally - to fill the screen, not the desktop-background problem.
« Last Edit: January 16, 2005, 12:20:56 PM by Corrosive »