SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    change background image

    I can't remember the DOM reference to change a document's background image...

    HELP!
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  2. #2
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    in IE, it's...
    Code:
    document.style.background
    i believe...

    Sketch
    Aaron Brazell
    Technosailor



  3. #3
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    http://server2.tacf.org/examples/test/

    is the site... It's like I've forgotten all my css/js *L*

    I just want the bg to change to white.jpg onClick of the link...
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  4. #4
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    got it, never mind...

    document.body.style.background or something... I was forgetting the .body.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  5. #5
    Kat's Meow Senior ******* WebKat's Avatar
    Join Date
    Jul 1999
    Location
    California USA
    Posts
    1,071
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about one of these background changer scripts?

    http://javascript.internet.com/bgeffects/

    And there are a number of JavaScript sites that you can search including these:

    24Fun.com - menus, scrollers, tickers, dynamic animations, image tricks, utilities, games: http://www.24fun.com/

    A1 JavaScripts - free javascript: http://www.a1javascripts.com/

    Just for future reference.....WebKat
    Dlynn :: SitePoint Senior Advisor ::
    PawPrint Designs by WebKat
    "Dogs come when they're called; Cats take a message and get back to you later." ~ Mary Bly

  6. #6
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by studiococo
    document.body.style.background
    That's right, but note that if you want to access CSS's background-image property, use:

    document.body.style.backgroundImage

    aDog


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
  •