I read this article regarding creating popup notes with javascript and css
The problem is that this one works only in IE since window.event is undefined in Firefox.
// assigns X,Y mouse coordinates to note element
note.style.left=event.clientX;
note.style.top=event.clientY;
So could you point me a fully working example? Or at least, how could i modify the javascript code to make it work in both internet browsers?
There are more than two browsers, but the following should work in most of them (adapted from the function on the page you linked to):
The problem is that not all browsers have an
eventproperty ofwindowand instead use an event object implicitly passed in as a parameter to an event handler function such asshowNote. Theevt = evt || window.event;line assignswindow.eventto theevtvariable if no event parameter was passed into the function (which is what happens in Internet Explorer).