General discussion

  • Creator
    Topic
  • #2121477

    Javascript question…

    Locked

    by kes_dude_2002 ·

    How do I change the backgound IMAGE using javascript?

    (not bgColor)

All Comments

  • Author
    Replies
    • #3653291

      Background Image

      by paul dost ·

      In reply to Javascript question…

      You can’t directly change the background image in javascript as there is no document.background attribute (although there is a layer.background). One way that looks like it should work (I haven’t tried it myself) is to create a CSS style and apply it to the body (e.g. ). Styles in JavaScript have both a backgroundColor and backgroundImage.

      I’ve gleaned this from Netscape’s JavaScript Client Reference which is available from their DevEdge site.

Viewing 0 reply threads