help: correct size background image?

S

sleem

I designed a little function to resize a window based on the clients
screen resolution, and apply an appropriate background image.

function resize_2_spec()
{
if (screen.width>640)
{
window.resizeTo(800,600);
document.body.style.backgroundImage = 'url(images/brunswickst600x800.jpg)';
}
else
{
window.resizeTo(640,480);
document.body.style.backgroundImage = 'url(images/brunswickst480x640.jpg)';
}
}

Problem is: how do I test it?

What's the easiest way?

Also, do you think that would work on all browsers?
 
D

David Dorward

sleem said:
I designed a little function to resize a window

Eugh. Thankfully browsers increasingly come with features that allow that
part of JavaScript to be selectively disabled.
Problem is: how do I test it?

By changing your resolution
Also, do you think that would work on all browsers?

No, certainly not.
 
L

Lee

sleem said:
I designed a little function to resize a window based on the clients
screen resolution, and apply an appropriate background image.
Problem is: how do I test it?

What's the easiest way?

Change your screen resolution setting.
Also, do you think that would work on all browsers?

No. Many people think it's extremely rude for a web site to
change the size of their windows, and modern browsers allow
them to prevent it via preference settings.


--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top