Hi! All I would like to re-size the background image of a web page to re-size and fit to the browser according to the screen resolution. Please help me with this.
Hi! All I did manage to get the background image scale according to screen resolution. http://www.krishnamraju.com But the code shows an error in IE. 1) Please help me rectifying it.
This is not working on mac. 2) Please help.
Thanks in advance.
Please have a look at www.visitlondon.com, they have the resizing background. How to achieve that?
Hi! Dave Yes, i want the visitlondon effect (primary) but the important one is the resizing one. Did you see my site? www.krishnamraju.com, can the code be enhanced so that there are no errors.
The script you use is written ie exclusive ("...if(navigator.appName == 'Microsoft Internet Explorer')..."). If you want to make it work cross browser I would consider making my own script. I could help you, but first I need to understand your excat aim.
You don't call rbOpen(); after your body, like is mentioned in the doc (point 4). Give it a try and tell me the result.
Note: I've just outcommented the if clauses outcluding any other browser than ie and fortunately opera supports all the other commands. Now I see what you mean. However I would like you to give me an exact description of the effect you would like (resizing in which direction, under which conditions etc.) and I'll see what I can do.
Allow me to share this tip... If you want to determine the precise dimensions of the *current* browser viewport excluding chrome, rather than the screen size, try the following *conditional* assignments in JavaScript, works in all browsers.
var Widthvariable = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth var Heightvariable = window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight
For the problem in hand, I would make a selective choice from one of say three or four versions of the background image, centred, by either using a conditioned... document.write("style{document.body.style.backgroundImage='url('+chosenpic+')'}") in the head or a style assignment after window.onload... document.body.style.backgroundImage="url("+chosenpic+")"
Hi! Dave & Gogogob Thanks a lot for the your thoughts.
Dave, I found that there is an error in the "disable select" JS file. I completely removed it and now there are no errors. I am happy with what's live right now. Dave, please help me with the script that is used on visitlondon.com, where the background stays as it is even if you re-size the browser. [oops! now they removed the background image ]
Just saying sorry here for the dog's dinner I served up in my last post... very tired! Then, you know how to write a style definition, as do I, when I'm with it!