25 users online (2 members and 23 guests)  


  Results 1 to 2 of 2

Related

  1. setting table background    Forum: Myspace Forum
    Replies: 2
  2. Setting Div widths    Forum: CSS Forum
    Replies: 0
  3. Dynamically Generating    Forum: Javascript Forum
    Replies: 3
  4. Dynamically Generating    Forum: HTML Forum
    Replies: 0
  5. Setting up my own hosting?    Forum: Web Hosting Forum
    Replies: 3
  1. #1
    Paco_Blanco's Avatar
    New User

    Status
    Offline
    Join Date
    May 2006
    Posts
    5

    Dynamically Setting <td> Background

    Hi. I hope someone has done this before.
    http://mariesgarden.sunknight.com/garden_show.htm the page this post relates to. I am trying to set the background to a border image in the first and last columns in the main table if the user's screen width is greater than 1152. This is working fine in IE, but safari does not like my code (
    Code:
    function detect_resolution(){
        if (screen.width>1152){
         document.getElementById("lb").background="Miscellany/border_left.gif";
         document.getElementById("rb").background="Miscellany/border_right.gif";
        }
       }
    ) for some reason. Any help with this would be greatly appreciated. Thanks.

  2. #2
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: Dynamically Setting <td> Background

    Hi there Paco_Blanco,

    I cannot test in 'Safari' but suggest that you use this...
    Code:
    
    function detect_resolution(){
        if (screen.width>1152){
         document.getElementById("lb").style.backgroundImage='url(Miscellany/border_left.gif)';
         document.getElementById("rb").style.backgroundImage='url(Miscellany/border_right.gif)';
        }
       }