Closed Thread Icon

Topic awaiting preservation: layerposition Pages that link to <a href="https://ozoneasylum.com/backlink?for=8133" title="Pages that link to Topic awaiting preservation: layerposition" rel="nofollow" >Topic awaiting preservation: layerposition\

 
Author Thread
tariq
Nervous Wreck (II) Inmate

From:
Insane since: Feb 2002

posted posted 04-01-2002 16:42

Hallo:
my task is to write a script, which shows something when the mouse moves over a certain region of the screen.

After I included a browser sniffer I wrote the following:

function loslegen() {
if (NS4) {
window.captureEvents(Event.MOUSEMOVE);
window.onMouseMove = MoveHandler; }
else{window.document.onmousemove =MoveHandler ;}

}

function MoveHandler(e) {
xpos = (document.layers) ? e.pageX : document.body.scrollLeft+event.x;
ypos = (document.layers) ? e.pageY : document.body.scrollTop+event.y;

x= eval(lst+"keinzut"+lse+llt);
y= eval(lst+"keinzut"+lse+ltp);
xx=x+300;
yy=y+100;
xn=x+5;
xxn=xx+5;


if ((xpos>=x && xpos<=xx)&&(ypos>=y && ypos<=yy)){ alert (x +"---" +y);
}
}

//end

this does not work under IE.
Any idea?

thanx

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 04-02-2002 07:22

It would be much easier to help if we could see all the relevant code. It's impossible to know for sure with the information you've posted.

I will take a guess and say that you are not calling the loslegen function with an onload event.


. . : newThing

tariq
Nervous Wreck (II) Inmate

From:
Insane since: Feb 2002

posted posted 04-04-2002 13:12

I do call the function with an onLoad event.
meanwhile I found that IE did not see any properies of the layer. So I put the layer style in the div tag. and it worked.

But because I call the loslegen function with the onLoad every mouse movement causes a n event and I was told that this will be a problem for old computers.

Now puting the event in the Layer it self seems not to work.

**********HTML*********
<div id="keinzut" style="position:absolute; left:10; top:600; font:normal 10px Arial; layer-background-color:green; background-color:green; border:0.1px solid green; width:300; height:100; z-index:1000" > TEXT</div>

********script********************

if (NS4) {
window.captureEvents(Event.MOUSEMOVE);
window.document.keinzut.onMouseMove = MoveHandler;
}
else if (IE){
window.document.all.keinzut.onmousemove =MoveHandler ;
}
else { window.document.getElementById("keinzut").onmouseover =MoveHandler;}

function MoveHandler(e) {
do something ( I want to let an other layer be visible)
}
************************************************

all browsers do not recognise the properties of the layer.

do any of you know how I can let the mouseover event works only in the layer

thanks

« BackwardsOnwards »

Show Forum Drop Down Menu