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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Screen Resolution script not working!!!

    Hello everybody,

    I'm trying to write a simple script that will enable me to use a perticular style sheet depending on the uses screen resolution,
    here's my current effort (doesn't work):

    <script language="JavaScript 1.2">
    var eight_width=800
    var six_height=600
    var one_width=1024
    var seven_height=768
    if (screen.width<=eight_width||screen.height<=six_height)
    {
    document.write('<link rel ="stylesheet" href="styles800.css" type="text/css">')
    }
    else if (screen.width>=one_width&&screen.height>=seven_height)
    {
    document.write('<link rel ="stylesheet" href="styles1024.css" type="text/css">')
    }
    </script>

    Any ideas where i'm going wrong?

    cheers

    Resis

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    New York, USA
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <script language="JavaScript 1.2">

    lose the space in that line.

    <script language="JavaScript1.2">

    hope that helps


  •  

    Posting Permissions

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