Skip navigation
Currently Being Moderated

BG image swap won't work - any ideas why not?

Feb 23, 2012 7:18 AM

Tags: #dreamweaver #code


Hi - I'm trying to set up a background image swap where when the user is viewing the site and clicking on links, the background image will change.  You'll see the soldier one there now and I have others.


The JS file the 2 HTML pages are linked to doesn't seem to be working [see above].


Any ideas why it's not working, or is there a better JS file anyone may be aware of that does what I'm looking for?


Thanks - Deaf Guy

  • Currently Being Moderated
    Feb 28, 2012 5:24 AM   in reply to Michael Walton

    Just give the <body> an id: <body id="swapBg">


    Then amend the script: /*<![CDATA[*/var el="swapBg";

    Mark as:
  • Currently Being Moderated
    Feb 28, 2012 5:53 AM   in reply to Michael Walton

    Change body to #swapBg as below:


    #swapBg {



        margin-left: 0px;

        margin-top: 0px;

        margin-right: 0px;

        margin-bottom: 0px;


    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points