• Resolved Integrantsvs

    (@bdwatt0)


    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: https://www.stampinchic.com/

    WordPress page (test): https://thestampinschach.integrantservices.com/

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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

    (@bdwatt0)

    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

    (@bdwatt0)

    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.