Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question html-background image can't scroll down

    Dear All

    I m learning to make a webpage. Hope you would pardon my silly question.

    I would like to use a pic as my background. I wonder how can i make the page flexible for all screen size. The pic is quite big, so when I upload it to the web site, a 640x480 screen can only show part of it and the scroll bar is not available.

    Would appreciate if someone can teach me the correct coding.

    Many thanks in advance.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Beyond Lament
    Posts
    424
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <HTML>
    <HEAD>


    <SCRIPT LANGUAGE="javascript">
    <!--//

    NS4 = (document.layers);
    IE4 = (document.all);
    scaleWidth = true;
    scaleHeight = true;

    imSRC = "your-image.jpg";

    if (NS4) window.onload = setResize;
    function setResize(){
    setTimeout("window.onresize=reDo;",500);
    }
    function reDo(){
    window.location.reload()
    }
    if (IE4) window.onresize = reDoIE;
    function reDoIE(){
    imBG.width = document.body.clientWidth;
    imBG.height = document.body.clientHeight;
    }
    function makeIm() {
    winWid = (NS4) ? innerWidth -1: document.body.clientWidth;
    winHgt = (NS4) ? innerHeight -1: document.body.clientHeight;
    imStr = "<DIV ID=elBGim" + " STYLE='position:absolute;left:0;top:0;z-index:-1'>" + "<IMG NAME='imBG' BORDER=0 SRC=" + imSRC;
    if (scaleWidth) imStr += " WIDTH=" + winWid;
    if (scaleHeight) imStr += " HEIGHT=" + winHgt;
    imStr += "></DIV>"
    document.write(imStr);
    }
    //-->
    </SCRIPT>


    </HEAD>
    <BODY>

    <SCRIPT LANGUAGE="JavaScript1.2">
    makeIm();
    </SCRIPT>




    ...the rest of your content here...

    </BODY>
    </HTML>

    Check out my site for an example.
    Quíet Storm Designs ~ Art is not what you see, but what you make others see.
    · the Storms· || ·Ultraviolent Winter· || ·Was Einstein Wrong?· || ·It´s About Time!·

  • #3
    New to the CF scene
    Join Date
    Sep 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    THANK YOU VERY MUCH FOR YOUR QUICK ASSISTANCE AND RESPONSE. VERY MUCH APPRECIATE IT.

    I wonder if you could advice some sources where I can learn more of the coding. Then I would not have to bother you too much.

    THANK YOU SO MUCH AGAIN


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •