Closed Thread Icon

Preserved Topic: Layer onmouseover Pages that link to <a href="https://ozoneasylum.com/backlink?for=18564" title="Pages that link to Preserved Topic: Layer onmouseover" rel="nofollow" >Preserved Topic: Layer onmouseover\

 
Author Thread
bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 09-20-2001 03:27

Hey all.

I'm rewriting some old code and I'd like to fix something that has been bothering me for a while.
I'm trying to figure out how to detect mouseover events for layers.

Up till now I've been actually calculating where the layer or div is, how wide/tall it is, tracking the mousepos and firing a function when the coords line up.

Now I'm pretty sure there has to be a way to detect an onmouseover event for a layer but I can't for the life of me figure it out. Any suggestions?



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 09-20-2001 03:57

In standards compliant browsers, it's just

document.getElementById("myID").onmousemove = eventHandler;
// info about event is in the Event object (window.event or just event);

In Netscape 4.x, it's weird:

document.mylayer.captureEvents(Event.MOUSEMOVE); // eliminate "on", capitalize the rest
document.mylayer.onmousemove = eventHandler;
// the equivalent of the Event object is passed into the function as an argument

It's possible I'm wrong, of course... I took that mainly from memory.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 09-20-2001 07:46

hmm..
That seems right but I tried that syntax with onmouseover (IE 6) and had no luck. I'll recheck my spelling and grammer.

Looking at yours though I have no problem using the onmousemove to fire the event as long as it doens't fire when I'm moving the mouse outside of the layer



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

DocOzone
Maniac (V) Lord Mad Scientist
Sovereign of all the lands Ozone and just beyond that little green line over there...

From: Stockholm, Sweden
Insane since: Mar 1994

posted posted 09-20-2001 11:45

Well, if all you're interested in is onMouseover and onM ouseout, in all borwsers but Netscape (old), you can just put these calls into the <div> tag just like you might have done for an <a href>. I don't know if this is something we're supposed to frown upon or not, but it works like a charm in all of my tests. (See http://www.ozoneasylum.com/lobby/ for an example of this, the windows used to be activated onMouseover, now I use onClick, all in the DIV tag.)

Your pal, -doc-

patric design
Bipolar (III) Inmate

From: 290 km/h, fast lane, Autobahn, Germany
Insane since: Feb 2001

posted posted 09-20-2001 20:48

Layers can have the normal onMouseOver behaviours applied as all links can.
I only came across this yesterday but Dreamweaver for example won't allow you to add a show/hide layer behaviour. It has to be hand coded...

<div id="Layer1" style="position:absolute; left:308px; top:89px; width:58px; height:73px; z-index:2; visibility: hidden" onMouseOver="MM_showHideLayers('Layer1','','show')" onMouseOut="MM_showHideLayers('Layer1','','hide')">

This works... (well...for me anyways ) In this particular example the event needs to be triggered by another mouseover though...

BTW: Can someone point me to the page of this forum where the UBB code is explained...

<´¯`·.¸ Patric ¸.·´¯`>

[This message has been edited by patric design (edited 09-20-2001).]

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 09-20-2001 21:38

UBB Code explanation...

« BackwardsOnwards »

Show Forum Drop Down Menu