Nov 22, 2009

Background Resize

free web hosting
Open Discussion > MODERATED AREA > Computers > Programming Languages > HTML, XML etc..

Background Resize

ExplosioN
Does anyone have the javascript for a background to resize? I want my background to resize to 1024x768 if the visitor has resolution 1024x768, to 800x600 if the resolution is 800x600 etc.

Greets,
ExplosioN smile.gif

Comment/Reply (w/o sign-up)

ExplosioN
oh I forgot to add, is it possible to make limits on it? Like the image won't resize anymore if the resolution is smaller then 800x600?

Comment/Reply (w/o sign-up)

truefusion
I think you can do it w/o javascript. Just make one for 1024x768, but make it so if it were to be seen in 800x600, it wouldnt be noticable. I've seen it done before. The layout would have to be aligned to the left, while the background would take care of the right side.

Comment/Reply (w/o sign-up)

Tyssen
You can't resize the background image, it'll only display at its full size, but you can serve up different images based on the browser size.
Use My Google to find a script that works for you.

Comment/Reply (w/o sign-up)

iwuvcookies
If you find the site could you please tell me to as I would like to know how to do this too. I'll join the search for this script too.

Comment/Reply (w/o sign-up)

(G)Eric Backer
Here is the answer that has evaded you X2! Your welcome.
Background Resize

There iare numerous ways this can be done.  Make sure on either method to change the image to your background of course.   Here are two different ways I just happen to have in my documents at the moment:

<script language="JavaScript1.2">

if (document.All||document.GetElementById)
Document.Body.Style.Background="url('YourIMG.Jpg') white center no-repeat fixed"

</script>
 

As you probably figured the script goes at the start of your body (inside of the body tags of course).

This is actually ment to give you a watermark effect so your background doesnt scroll but it will also work for your resizing issue.   Here is another way to do it using div's:

<div style="position:absolute; width:100%; height:100%; margin:0px; padding:0px; left:0px; right:0px;z-index:1">
 <img src="YourIMG.Jpg" width="100%" height="100%"></div>

<div style="z-index:2; position:absolute; margin:0px; padding:0px; height:100%; width:100%; overflow:scroll;">

<p>&nbsp;</p>
<p>THIS IS THE CONTENT</p>

</div>

-reply by Eric Backer

 

 

 

 


Comment/Reply (w/o sign-up)

kleong
I dont remember coming across a javascript that enable to you to detect the screen resolution. I would like to know if there is one. As suggestion, why not create a website with a liquid width? In that case, you need not worry abt the screen resolution of your users.

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : background, resize

  1. Background Question
    :) (12)
  2. Ok Background Help Please
    html (4)
    OK so i've given up on the paint for background now how would i get it to look like this
    http://img.photobucket.com/albums/v614/Dj1.../background.jpg without using paint and without it
    coming out to look like this... http://img.photobucket.com/albums/v614/Dj169211/Damn.jpg like,
    with just html code, not trying to use paint and do the BS any ideas?....
  3. Help With Background Image
    please? :) (6)
    Ok heres the scoop, i got a background that i made in paint for my website its just like 3 lines for
    the nav bar, banner and other things ect. ect. now when i hosted it on a site and put in the This
    is what it looks like in paint http://img.photobucket.com/albums/v614/Dj1.../background.jpg and
    this is what it looks like when i put it into HTML
    http://img.photobucket.com/albums/v614/Dj169211/Damn.jpg i dont want it tiled like that so is
    there any way that i can change that? any ideas? :| Thanks in advance /smile.gif"
    style="vertical-align:middle" emoid=":)" borde....
  4. Background Image Picture On A Website
    how do u make a pic a backround?? (3)
    ?email me if u know! Trap17 forum asks you to post contributes with substance. ....
  5. Usemap And Table Background Image Changing
    (5)
    I have a menu page that consists of links to other pages. The page has a background image of a
    globe. The globe is divided into seperate sections for each menu item. As a user hovers over each
    section I change the background image(The same globe with that section highlighted.) That is what I
    have so far except that they have to hover over a small anchor tag that I put in not the whole
    section. I want to change it so that they can actually hover over all of the section they are
    selecting. I found usemap online but haven't found any examples where it will actually ch....
  6. Fixed Background Image
    Just little reminder (12)
    Easy teahnic, post the following codes between and QUOTE body{background-image: url(
    under.gif ); background-repeat:no-repeat; background-attachment : fixed; background-position:
    10% 20% ;} --> For red colour, change it to your image's location. For green colour, it
    is used to set horizontal and vertical position of background image. I hope it can help you.
    /tongue.gif' border='0' style='vertical-align:middle' alt='tongue.gif' /> ....
  7. Background Fit Any Resolution
    hmmm (9)
    Is it possible to do with html. I have found a few solutions but they dont seem to work. I know it
    is possible in java. But anyone have the code for html? Would really appreciate it.....
  8. Background Not Big Enough
    (4)
    Hi: Ok, first off....moderaters, please move this topic to the appropriate category. I really
    couldn't find a spot to put this in...so I just picked one. Here is the page I have a question
    about: http://histology-world.com/articles/article9.htm The problem? Scroll down and you can
    see. My background image is not long enough. I have gone into my photo editor and readjusted it,
    just made the canvas size larger. But then I am starting to get concerned about file size. I want
    the lights at the top. When the background image repeats itself, the lights are ins....

    1. Looking for background, resize

Searching Video's for background, resize
See Also,
advertisement


Background Resize

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com