IE JavaScript onMouse event fix

IE JavaScript onMouse event fix

From mouse events: mousedown, mouseup and click, dblclick, mousemove and finally mouseover and mouseout. Like wasn’t enough the bad css support, IE have a strange way to look at an event object what is working just fine on any other browser.

reADactor

Try to be a mixer of inspiration, source of tutorials, tips and a reactor of your future design ideas, a place from where you can download freebies, vectors and web templates. Follow us on Twitter and Facebook

If you are using a known javascript library, then you probably will not meet this situation. For instance, you may have a moving code for an image or a div according to the mouse position on screen:

function onMouseMove(e) {

Before to any variables, paste this code to make it to work and on IE browsers:

if (e == null)
e = window.event;

Otherwise, your javascript code will be stoped by IE.


Even isn’t a big deal at first sight, following a recent list with javascript animantions, i saw that many was not working on Internet Explorer. We like or not, over 35% from internet users (over 45% according to other statistics) use IE browsers – 10% are just for IE6!?!

Published on: February 5th in Tutorials .
Post tags: , , , , , , , , , , , , ,

Be The First To Comment

Leave A Comment.