SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Safari Dislikes onload

    Hi. I am having trouble changing backgrounds dependant upon screen res in safari. This code works fine in IE, but safari does not like it for some reason:
    Code:
    function detect_resolution(){
     if ((screen.width>1152)||(screen.height>864)){
      document.getElementById("lb").background="Miscellany/border_left.gif";
      document.getElementById("rb").background="Miscellany/border_right.gif";
     }			
    }
    I am wondering if it is because this is called in the onload, or if it has to do with screen resolution.
    Page in question: Garden Show.
    Thanks very much in advance for any help with this .
    ~Che
    Last edited by Che_Guava; Jul 2, 2006 at 20:18. Reason: Needed better title....

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try
    Code:
    document.getElementById("lb").style.backgroundImage = "url(myImage.gif)";


Bookmarks

Posting Permissions

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