How do I code a page to invert an image if the user moves the mouse over it?
| SitePoint Sponsor |
How do I code a page to invert an image if the user moves the mouse over it?

A real cheap and nasty way is to add a onMouseOver attribute to the image.
<img src="img1.jpg" onMouseOver="this.src='img2'" onMouseOut="this.src='img1'" alt="">
hmmm.. a really cheap and nasty way.
Can I add the invert filter with this code?

Are you talking about Internet Explorer's proprietary style filter ?
That would make it even cheaper and nastier!
I need the invert filter to be applied when the mouse over occurs
<img src = "pic.jpg" style = "filter: invert" alt = "pic"/>

Code:<img src="img1.jpg" onMouseOver="this.src='img2'; this.style.filter='invert'" onMouseOut="this.src='img1'; this.style.filter=''" alt="">
Thanks that got it working, would you know how to code a script to blurs an image then slowly unblurs it when it finishes loadingusing the onload event?

You may want to Google javascript libraries like scriptaculous.
Bookmarks