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
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts

    is it simple to apply alternate CSS style IF resolution > X,Y?

    hey all,

    If this is overly complicated then forget it, but does anyone have a script whereby IF the users resolution is > a particular setting (say 1024x768), then apply THIS css to THESE objects?
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #2
    Regular Coder
    Join Date
    Mar 2006
    Posts
    726
    Thanks
    35
    Thanked 132 Times in 123 Posts
    if(screen.width>1024 && screen.height>768){
    either document.write the link element in the head while it is loading
    or after onload use createElement('link') and append it to the
    head
    }
    But it's poor practice to base css on the user having javascript.


  •  

    Posting Permissions

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