Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Jul 2003
    Posts
    6
    Member #
    2249
    I'm designing a site using frames (for the first time).

    I use the following script to auto-resize the page(s) for different screen resolutions:

    <SCRIPT language=JavaScript>
    <!--
    var Nav_browser = document.layers;
    if (Nav_browser) {
    var beginWidth = innerWidth;
    var beginHeight = innerHeight;
    }
    function reloadWindow() {
    if (innerWidth != beginWidth || innerHeight != beginHeight)
    location.reload();
    }
    if (Nav_browser) onresize = reloadWindow;
    //-->
    </SCRIPT>

    This works fine but the bg. needs to have a strip of blue, 1/3rd the width of the page on the right side. It looks fine with 1024x768 but this this bg. image obviously won't resize with the above script to look okay on 800x600. Is there a script to load another bg. image when someone is using say, 800x600 screen resolution or is there another solution I'm missing

    Thanks

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    hmm.... try this:

    Code:
    switch (screen.availWidth) {
        case 640:
            var imgSrc = '640.gif';
        break;
        case 800:
            var imgSrc = '800.gif';
        break;
        case 1024:
            var imgSrc = '1024.gif';
        break;
        default:
            var imgSrc = '1280.gif';
        break;
    }
    document.getElementById('blueStrip').background = imgSrc;
    Put that snippet into your reloadWindow() function.

    Then give your cell that has the background an id, like such:
    Code:
        <td background="640.gif" id="blueStrip">
    That should do it !!!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:14 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com