[Javascript] Onmousemove event

Flavio Gomes flavio at economisa.com.br
Tue Jul 27 12:42:49 CDT 2004


The effect you want is something like this?
  Check attachment.

Flavio Gomes
flavio at economisa.com.br



Iztok Polanic wrote:

>Hi!
>
>Me again. I hope this time without quarrell. :) Below is a script which
>works find in IE but not so good in Firefox.
>
>var IE = document.all ? true : false;	
>	
>if (!IE) {
>	window.captureEvents(Event.MOUSEMOVE);	
>	window.onmousemove = mouse_move;
>} else 
>	document.onmousemove = mouse_move;		
>
>function mouse_move(e) {
>	if (IE) {
>		tempX = event.clientX;
>		tempY = event.clientY;
>	} else {
>		tempX = e.pageX;
>		tempY = e.pageY;
>	}
>	
>	// lay
>	leftPos = document.getElementById('lay').offsetLeft;
>	topPos = document.getElementById('lay').offsetTop;
>	sirinaPos = document.getElementById('myrange').offsetWidth;
>	visinaPos = document.getElementById('myrange').offsetHeight;
>	
>	if(tempX >= leftPos && tempX <= (leftPos + sirinaPos) && tempY >=
>topPos && tempY <= (topPos + visinaPos)) 
>		document.getElementById('lay').style.display = 'none';
>	else
>		document.getElementById('lay').style.display = '';
>}
>
>In Firefox the picture is displaying and dissapiring. Why? How can this be
>fixed?
>
>Bye,
>
>Iztok
>  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20040727/d022731d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lay.GIF
Type: image/gif
Size: 1076 bytes
Desc: not available
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20040727/d022731d/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: myrange.GIF
Type: image/gif
Size: 1297 bytes
Desc: not available
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20040727/d022731d/attachment-0001.gif>


More information about the Javascript mailing list