I have been experimenting with dispatching events in Firefox and noticed that dispatching the mouseover event on a link does not cause its style to change to that defined in the :hover CSS class. Dispatching the 'click' event does change the link style to :active. Any reason for this behavior or I am doing something wrong in my code?
var myElement = document.getElementById("myLink");
var ev = document.createEvent("MouseEvents");
ev.initMouseEvent("mouseover", canBubble, cancelable, view,
detail, screenX, screenY, clientX, clientY,
ctrlKey, altKey, shiftKey, metaKey,
button, relatedTarget);
myElement.dispatchEvent(ev);
If the event type is click it will execute the event and change ev's style to one defined in ":active" pseudo-class.
I am trying to make a script which can record on-screen events and then play them back.
Update: Found DejaClick for Firefox. The hover on things like drop down menus does work properly.