Results 1 to 3 of 3

Thread: change bg by clicking

  1. #1
    Join Date
    Dec 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation change bg by clicking

    http://www.dynamicdrive.com/dynamici...imagelight.htm

    On this page you have the option to "Click to see how the images look in a black background..." then the background goes black. You can click again to make it white again. How are you able to do that?

  2. #2
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    This is the code used:

    Code:
    <script language="JavaScript1.2">
    function changesettings(){
    if (document.all){
    if (document.body.style.cssText==''||document.body.style.backgroundColor=='white')
    document.body.style.cssText="background-color:black;color:white;background-image:url()"
    else
    document.body.style.cssText="background-color:white;color:black"
    }
    }
    </script>
    
    <a href="changesettings();">Click here</a>
    Is the code used to change the backdrop. It only works in Internet Explorer.

    cr3ative
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

  3. #3
    Join Date
    Dec 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Im still a little confused. When I tried to use it, it went to a new page.
    Last edited by TurdFurgason; 12-17-2004 at 03:28 AM.

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
  •