69 users online (0 members and 69 guests)  


  Results 1 to 4 of 4

Related

  1. Test Screen Res    Forum: Javascript Forum
    Replies: 0
  2. Screen Size detect and CSS    Forum: CSS Forum
    Replies: 1
  3. Replies: 2
  4. Screen sizing    Forum: HTML Forum
    Replies: 4
  5. screen size compatibility    Forum: HTML Forum
    Replies: 1
  1. #1
    freestyling's Avatar
    New User

    Status
    Offline
    Join Date
    May 2003
    Posts
    2

    Lightbulb different background with different screen size

    Basically, I have a php gallery http://34thnottinghamscouts.org.uk/gallery running with a fixed background image which is set through a single style sheet. The sheet is at http://34thnottinghamscouts.org.uk/gallery/css/standalone_style.css.default - the relavant bit being at the bottom of the page. Is there anything I can add to this that will select a different url for the background with different screen sizes?
    Last edited by HTML; 03-20-2007 at 08:42 PM.

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    You could detect the resolution with JavaScript easilt enough (use the Search functions of the forum to find a script for this, there have been quite a few examples here and there) and then use javascript to document.write the relevent style information into your page.

    Welcome to the forums, btw. Always nice to see another brit around here
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316
    <script language=Javascript>
    <!--
    var background
    if (screen.height == 600) && (screen.width == 800)
    {
    background = "";
    document.write (background);
    }
    elseif (screen.height == 768) && (screen.width == 1024)
    {
    background = "";
    document.write (background);
    }
    else
    {
    background = "";
    document.write (background);

    }
    -->
    </script>

    //include as many conditions as u want
    hope that helps

  4. #4
    freestyling's Avatar
    New User

    Status
    Offline
    Join Date
    May 2003
    Posts
    2
    Heh, thank you both for the replies, it's given me more than the bit of guidance I was expecting.



Tags for this Thread