473,385 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Help with onmouseout and layers, please.

I have a DIV that becomes visible when a link above it is moused over.

The DIV has links in it like so:

<div class="popup" onmouseout="hideLayer(this);">
<a class="popuplink" href="page1.html">Link 1</a><br/>
<a class="popuplink" href="page2.html">Link 2</a><br/>
<a class="popuplink" href="page3.html">Link 3</a><br/>
<a class="popuplink" href="page4.html">Link 4</a><br/>
</div>

When you mouse out of the div, it goes back into hidden. But as soon as I
touch any of the links, it hides, thinking I've left the DIV.

Now, I'm assuming this is a z-index layer issue, but I've tried every
combination of things I could think of to prevent the mouseout action when
mouseing over one of the links.

I tried setting div.popup's z-index higher than a.popuplink's, lower than
a.popuplinks, and the same as. (I did set each to a position as well.)

What am I missing?
--
Sugapablo
http://www.sugapablo.net

Dec 9 '05 #1
2 1931
Ivo
"Sugapablo" wrote
I have a DIV that becomes visible when a link above it is moused over.

The DIV has links in it like so:

<div class="popup" onmouseout="hideLayer(this);">
<a class="popuplink" href="page1.html">Link 1</a><br/>
<a class="popuplink" href="page2.html">Link 2</a><br/>
</div>

When you mouse out of the div, it goes back into hidden. But as soon as I
touch any of the links, it hides, thinking I've left the DIV.

Now, I'm assuming this is a z-index layer issue,


z-indeces have nothing to do with it. When the mouse enters the <a> element,
the onmouseout event handler of the parent <div> element is called like it
should. You don't show us your code, but I presume that is how you have set
up things: an onmouseout event handler for that div. So check in the
handling function if the calling element is a child of your popping div, and
if it is, leave the div alone, only proceed when the current element in not
in the div. Be warned there may be other elements inside an <a>, an <i> for
example, so a simple look at at the element's parentNode will not do.
Instead loop through the parentNodes until you hit either the <div> (give it
an id for easy recognition) or the <body> in which case you can safely
proceed with with hiding.

hth
ivo
http://4umi.com/
Dec 9 '05 #2
On Fri, 09 Dec 2005 20:28:58 +0100, Ivo wrote:
So check in the handling function if the calling element is a child of
your popping div, and if it is, leave the div alone, only proceed when
the current element in not in the div.


How would I do that? is the child element "calling" anything for me to
tell the handling function?
--
Sugapablo
http://www.sugapablo.net

Dec 9 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: yoelgold | last post by:
hi can someone please tell me what "document.MM_sr" is. I tried searching for a explanation on the web but cant find anything. What does MM_sr represent? and where can i get documentation on it. ...
2
by: BillyTheKid | last post by:
Hello, I am very new to java and I have pasted the following code onto my website: #########################################3 <SCRIPT language=JavaScript> <!-- function...
2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
5
by: althafexcel | last post by:
hi everyone Im trying to include an external js in my aspx page under the head tag, it doesn't load or it displays an object expected error whenver the function from the .js is called. Actually...
2
by: gunnuk | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta...
0
by: sknonline | last post by:
Greetings. I am having troubles using absolute positioning in IE6. When I establish the width as 100%, it's not spanning the entire width of the browser. It works in Firefox, Safari, and IE7.......
5
by: loveshack | last post by:
Can anyone help me please (i am quite a novice, but having fun learning). Im not sure if this is an ASP problem, a javascript problem or a browser problem. Firstly, everything i have written...
2
by: registry | last post by:
<%@Language="VBSCRIPT" CODEPAGE="1252"%> <html> <head> <title>Registry Network Hospital Detail</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.