Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onmouseover

Status
Not open for further replies.

ck1999

Technical User
Dec 2, 2004
784
US
Why would someone use javascript to set a mouseover instead of just specifying the image.

I am speaking only for swapping images to show the link being moused over. I am not talking about menus or pictures poping up other places on the screen.

Thanks for the clarification.

ck1999
 
I'm not sure what you are asking.

The Onmouseover event fires when you hover the mouse over your link. If your link is an image and you want to change it you can use it. If your link is text, then there really is no use of the onmouseover event unless you are wanting something else to happen, perhaps run a JS function upon hovering that then does something

However with CSS you can use the :hover pseudo class to accomplish the same thing on links.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
thank you for your reply.

I was noticing websites that instead of saying onmouseover="src='images/plabel2.gif'"

they would use
onMouseOver="MM_swapImage('Image6','','images/msds_on.gif',1)"

Which does the exact same thing by appearance. So I am curious as to why? Does it have anything to do with validation or just the way other people write their sites.

ck1999
 
MM_swapImage is Macromedia (now Adobe) Dreamweaver's JavaScript routine that swaps images.

And, technically, onmouseover="src='images/plabel2.gif'" is an implied script.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top