As soon as the page loads, if you check the console, you see the function fires before I mouseover the elements. If I remove the parameters, then the page waits for me to mouseover the elements, but I lose the dynamic functionality. Am I doing something wrong with passing the elements?
var myList = ["hoverOne", "hoverTwo"];
for(var i=0; i < myList.length; i++){
document.getElementById(myList[i]).onmouseover=changeImage(myList[i]+"Image");
}
function changeImage(thisDiv){
console.log(thisDiv);
//show/hide code here
}
Here is a link to the fiddle I was playing with: http://jsfiddle.net/QtG9P/33/