Title: Script Header Image
Last modified: August 22, 2016

---

# Script Header Image

 *  Resolved [Integrantsvs](https://wordpress.org/support/users/bdwatt0/)
 * (@bdwatt0)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/script-header-image/)
 * I have a client that is on Blogger, and is thinking about moving to WordPress.
   The only hangup with the migration is her Blogger header. It was custom designed
   in text/javascript to call images and perform actions on mouseover. I can’t for
   the life of me to get it to load correctly in WordPress, no matter the theme 
   I choose. I can get the header with all it’s images to appear, but the mouseover’s
   aren’t functioning. Any help would be appreciated.
 * Blogger page: [http://www.stampinchic.com/](http://www.stampinchic.com)
 * WordPress page (test): [http://thestampinschach.integrantservices.com/](http://thestampinschach.integrantservices.com/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [devbynature](https://wordpress.org/support/users/devbynature/)
 * (@devbynature)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/script-header-image/#post-5577787)
 * You have to add the custom JavaScript to the theme (probably best in the footer)
   then use or create an ID for the header that will be used to change the image.
 * The custom javascript is as follows:
 *     ```
       <!--
   
       function newImage(arg) {
       	if (document.images) {
       		rslt = new Image();
       		rslt.src = arg;
       		return rslt;
       	}
       }
   
       function changeImages() {
       	if (document.images && (preloadFlag == true)) {
       		for (var i=0; i<changeImages.arguments.length; i+=2) {
       			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
       		}
       	}
       }
   
       var preloadFlag = false;
       function preloadImages() {
       	if (document.images) {
       		Videos_over = newImage("https://sites.google.com/site/thestampinschach/Videos-over.png");
       		Videos_Rewards_over = newImage("https://sites.google.com/site/thestampinschach/Videos-Rewards_over.png");
       		Rewards_over = newImage("https://sites.google.com/site/thestampinschach/Rewards-over.png");
       		Rewards_Join_over = newImage("https://sites.google.com/site/thestampinschach/Rewards-Join_over.png");
       		Join_over = newImage("https://sites.google.com/site/thestampinschach/Join-over.png");
       		Join_Specials_over = newImage("https://sites.google.com/site/thestampinschach/Join-Specials_over.png");
       		Specials_over = newImage("https://sites.google.com/site/thestampinschach/Specials-over.png");
       		Specials_Products_over = newImage("https://sites.google.com/site/thestampinschach/Specials-Products_over.png");
       		Products_Specials_over = newImage("https://sites.google.com/site/thestampinschach/Products-Specials_over.png");
       		Products_over = newImage("https://sites.google.com/site/thestampinschach/Products-over.png");
       		Awards_over = newImage("https://sites.google.com/site/thestampinschach/Awards-over.png");
       		preloadFlag = true;
       	}
       }
   
       // -->
       ```
   
 * Just add it and modify accordingly.
 *  Thread Starter [Integrantsvs](https://wordpress.org/support/users/bdwatt0/)
 * (@bdwatt0)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/script-header-image/#post-5578014)
 * Thanks devbynature!
 * I’m so NOT a coder. I copied the custom code into the footer.php for the custom
   theme I’m working with. How do I go about “use or create an ID for the header
   that will be used to change the image.”
 *  Thread Starter [Integrantsvs](https://wordpress.org/support/users/bdwatt0/)
 * (@bdwatt0)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/script-header-image/#post-5578022)
 * Got it; copied the html that calls the table and images into the header, and 
   the java script into the footer. also had to set the var preloadFlag equal to
   true in order for it to work. Thanks devbynature!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Script Header Image’ is closed to new replies.

## Tags

 * [header](https://wordpress.org/support/topic-tag/header/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 3 replies
 * 2 participants
 * Last reply from: [Integrantsvs](https://wordpress.org/support/users/bdwatt0/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/script-header-image/#post-5578022)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
