View Single Post
  #1 (permalink)  
Old 10-18-09, 07:44 AM
knolly knolly is offline
Newbie Coder
 
Join Date: Apr 2009
Posts: 14
Thanks: 2
Thanked 0 Times in 0 Posts
onmouseover from external js

This has got to be so simple but I can't see what I'm doing wrong. Basically if I do this :

Code:
<img src="image.jpg" alt="" onmouseover="rollOverText('bio')"  />
then my rollOverText function works fine. But if I try to put the onmouseover in an external .<acronym title="JavaScript">js</acronym> file it doesn't work. Here's how I'm trying to do it:

Code:
<img src="image.jpg" alt="" id="biog"  />
and the script in the .<acronym title="JavaScript">js</acronym> file:


Code:
function menuRollovers() {
		document.getElementById('biog').onmouseover= rollOverText('bio');
}
	window.onLoad= menuRollovers();

Is this really obvious?

Thanks!
Reply With Quote