I am using the below pre-built script for my mouseover images:
<script src="js/chrisdomroll.js">
/****************************************************
* DOM Image rollover v3.0: By Chris Poole http://chrispoole.com
****************************************************/
</script>
And it works on the page simply by adding the following attribute to the image tag, with the behind being the mouseover image's url. Yes, it works.
class="domroll button/l1b.png"
But i have an external JS file that writes functions to the page, attached to the page.
There are some switch cases (i can post them in their entirety if you want), but the main purpose is that it changes the html of the DIV with the ID "home".
document.getElementById("home").innerHTML='';
var home='<a href="#" onClick="afis(1);"><img src="button/l5b.jpg" border="0" class="domroll button/l5.jpg"/></a>';
Note that the image "button/l5b.jpg" shows. But the mouseover effect done with "class=domroll button/l5.jpg" does not.
At first i guessed it could be a file path problem with the image, but later i realise i don't even see the red X that indicates a broken image. So i am guessing that this JS file cannot read another JS file?
The hierarchy of the file is like this:
- index.html
- js/chrisdomroll.js (the mouseover class)
- js/writefunctions.js (the class i used to write my own functions)
It does not seem to work either when i pasted the whole chunk of javascript from writefunctions.js into index itself.
Also, while the div shows properly in other browsers, it does not show up at all in Safari.
Whats wrong? Thanks for reading and your advice in advance.
Let me know if you need to see the files to figure the mistakes.
Cheers.