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.

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!?!

With testking 640-721 course, learn how to build creative web page in JavaScript framework. Download testking 642-374 design tutorials and testking 642-873 study guide to become expert.

Network News

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

One Comment

Leave A Comment.