table background in Mozilla vs IE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sam Carleton

    #1

    table background in Mozilla vs IE

    I am having problems with understanding how to change the background
    of a table in Mozilla. On this page
    <http://www.miltonstree t.com/scarleton/photo/index.php> I am setting
    the background of the table to that of the image one can actually
    see and then using a null image over it.

    In IE, I have it working where when you move the mouse over the
    image, the image changes to a different image. For some reason this
    does not work in Mozilla. Any idea why?

    Sam
  • Martin Honnen

    #2
    Re: table background in Mozilla vs IE



    Sam Carleton wrote:
    [color=blue]
    > I am having problems with understanding how to change the background
    > of a table in Mozilla. On this page
    > <http://www.miltonstree t.com/scarleton/photo/index.php> I am setting
    > the background of the table to that of the image one can actually
    > see and then using a null image over it.
    >
    > In IE, I have it working where when you move the mouse over the
    > image, the image changes to a different image. For some reason this
    > does not work in Mozilla. Any idea why?[/color]

    You have

    function UpdateImage(nIn dex)
    {
    var TableObj = document.getEle mentById("TheTa ble");
    TableObj.backgr ound = ImageArray[nIndex].src;
    }

    make that

    function UpdateImage(nIn dex)
    {
    var TableObj = document.getEle mentById("TheTa ble");
    if (TableObj && TableObj.style) {
    TableObj.style. backgroundImage =
    'url(' + ImageArray[nIndex].src + ')';
    }
    }

    and it should work with IE4+, Netscape 6+, Opera 7
    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    Working...