CodeBelly.com
CodeBrain.NET

Home
Java Applets
Popup Maker
Top Picks
New Scripts
Java Scripts

Background Image-Change from Link
Back to JavaScript Main Index

Use this script to change the background image used in the page from a link.  Shows how to attach to a regular (clicked) link, or how to activate the background image change on a mouseOver.  Easy.

.
PART ONE
Installing The Script

Place this script immediately after the <BODY> tag of your page.  You can add as many images as you wish; see the instructions in the script.  It's best to use very small (file size, that is) images to get optimal performance.

  Note that the number in brackets [ ] in the backImage[ ] array is the number you will use to call each image from the changeBGImage(whichImage) function (see Part Two below).

Click here to select the code in the window below.
Use Ctrl+C to copy it to your clipboard.

PART TWO
Setting Up The Links

There are two examples below.  The first shows how to set up a link so that it will change the background image on mouseOver.  The second shows how to set up a link that will change the background image when clicked.

Click here to select the code in the window below.
Use Ctrl+C to copy it to your clipboard.


Home Java Applets JavaScript Index Resources New Scripts
www.CodeBrain.com Need Still More Scripts? www.CodeLifter.com

Copyright 1996 - 2012 by OEC Corp and CodeBelly.com


CodeBrain InterNET
Group
www.CodeBrain.com www.BrainCode.com www.CodeLifter.com www.MicroTicker.com
www.etLux.com www.OECCorp.com www.CodeBelly.com www.CodeFoot.com
www.jsCode.com www.TrayApps.com www.PopUpWorks.com www.Droiddd.com