473,322 Members | 1,494 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,322 software developers and data experts.

set/adjust z-index onmouseover

What would be the correct syntax for setting the z-index of a layer
OnMouseOver?

I have a mouseover action on a visible layer which displays a popup info
layer but it gets displayed behind other visible layers depending on its ID
which I beleive is inherited from its parent. I need the popup layer to
display in front of everything on the page when activated.

<DIV ID="popinfo<%=rs("ID") %>" STYLE="padding:0px; border:1px solid
#000000; position: absolute; width: 300px; height: 220px; left: 36px;
top: -1px; z-index: <%=rs("ID") %>" ; background-color:#2D5B8E;
visibility:hidden">

Thanks in advance!

Jul 23 '05 #1
5 33958
Jake <sp******@alltel.net> wrote in message
news:jq************@fe10.usenetserver.com...
What would be the correct syntax for setting the z-index of a layer
OnMouseOver?

I have a mouseover action on a visible layer which displays a popup info
layer but it gets displayed behind other visible layers depending on its ID which I beleive is inherited from its parent. I need the popup layer to
display in front of everything on the page when activated.

<DIV ID="popinfo<%=rs("ID") %>" STYLE="padding:0px; border:1px solid
#000000; position: absolute; width: 300px; height: 220px; left: 36px;
top: -1px; z-index: <%=rs("ID") %>" ; background-color:#2D5B8E;
visibility:hidden">

Thanks in advance!

It's better to simplify the syntax by writing a function to do the job.
Here's an example using two simple layers. I chose to style the popup
initially visible.

<html>
<head>
</head>
<body>

<DIV id='popup' style="position:absolute;left:100px; top:50px;
background-color:#ffff00;z-index:0;visibility:visible;">Popup text
layer</DIV>
<DIV onmouseover='toTop("popup",true,100)'
onmouseout="toTop('popup',false,0)" id='perm'
style="position:absolute;left:50px; top:55px;
background-color:#ff0000;z-index:1">The Permanent Layer</DIV>

<script type='text/javascript'>

function toTop(layer, action, z) // layer== id of div, action:
true==show,false==hide, z==z index
{
var lref;

if(document.getElementById && (lRef=document.getElementById(layer)))
{
lRef.style.visibility=action?'visible':'hidden';
lRef.style.zIndex=z;
}
}
</script>
</html>

--
S.C.
http://makeashorterlink.com/?H3E82245A

Jul 23 '05 #2
Thanks for the reply but I cant get your sample to work.

Error: Expected '{'
"Stephen Chalmers" <ig******@lycos.co.uk> wrote in message
news:42**********@mk-nntp-2.news.uk.tiscali.com...
Jake <sp******@alltel.net> wrote in message
news:jq************@fe10.usenetserver.com...
What would be the correct syntax for setting the z-index of a layer
OnMouseOver?

I have a mouseover action on a visible layer which displays a popup info
layer but it gets displayed behind other visible layers depending on its

ID
which I beleive is inherited from its parent. I need the popup layer to
display in front of everything on the page when activated.

<DIV ID="popinfo<%=rs("ID") %>" STYLE="padding:0px; border:1px solid
#000000; position: absolute; width: 300px; height: 220px; left: 36px;
top: -1px; z-index: <%=rs("ID") %>" ; background-color:#2D5B8E;
visibility:hidden">

Thanks in advance!

It's better to simplify the syntax by writing a function to do the job.
Here's an example using two simple layers. I chose to style the popup
initially visible.

<html>
<head>
</head>
<body>

<DIV id='popup' style="position:absolute;left:100px; top:50px;
background-color:#ffff00;z-index:0;visibility:visible;">Popup text
layer</DIV>
<DIV onmouseover='toTop("popup",true,100)'
onmouseout="toTop('popup',false,0)" id='perm'
style="position:absolute;left:50px; top:55px;
background-color:#ff0000;z-index:1">The Permanent Layer</DIV>

<script type='text/javascript'>

function toTop(layer, action, z) // layer== id of div, action:
true==show,false==hide, z==z index
{
var lref;

if(document.getElementById && (lRef=document.getElementById(layer)))
{
lRef.style.visibility=action?'visible':'hidden';
lRef.style.zIndex=z;
}
}
</script>
</html>

--
S.C.
http://makeashorterlink.com/?H3E82245A


Jul 23 '05 #3
In article <3e*************@fe10.usenetserver.com>, sp******@alltel.net
says...
Thanks for the reply but I cant get your sample to work.

Error: Expected '{'

That's because his code wrapped. If you really can't figure out that
problem for yourself, you might want to look at one of the many free
javascript tutorials on the web, and focus on the troubleshooting
sections. The line which begins "true==show" can be safely deleted or
can be returned to its original position at the end of the line above
it.
function toTop(layer, action, z) // layer== id of div, action:
true==show,false==hide, z==z index
{
var lref;

Jul 23 '05 #4


Jake <sp******@alltel.net> wrote in message
news:3e*************@fe10.usenetserver.com...
Thanks for the reply but I cant get your sample to work.


It's a line-wrap problem. Replace the function with this:

// layer== id of div, action:true==show,false==hide, z==z index
function toTop(layer, action, z)
{
var lref;

if(document.getElementById && (lRef=document.getElementById(layer)))
{
lRef.style.visibility=action?'visible':'hidden';
lRef.style.zIndex=z;
}
}

--
S.C.

http://makeashorterlink.com/?H3E82245A

Jul 23 '05 #5


Jake <sp******@alltel.net> wrote in message
news:3e*************@fe10.usenetserver.com...
Thanks for the reply but I cant get your sample to work.


It's a line-wrap problem. Replace the function with this:

// layer== id of div, action:true==show,false==hide, z==z index
function toTop(layer, action, z)
{
var lref;

if(document.getElementById && (lRef=document.getElementById(layer)))
{
lRef.style.visibility=action?'visible':'hidden';
lRef.style.zIndex=z;
}
}

--
S.C.

http://makeashorterlink.com/?H3E82245A

Jul 23 '05 #6

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

Similar topics

3
by: dreamer | last post by:
I am making a program for a friend with a disability. I need to adjust his audio volume using the keyboard as he cannot use a mouse. Any suggestions as to how I can raise the volume using the up...
0
by: Jeff O. | last post by:
Has anyone written a class to adjust their Timer period for daylight savings time? Or, is there another way to have the timer automatically adjust for DST?
3
by: Matthew | last post by:
Hello ~ I am looking for a character counter that will display the remaining number of characters left in a form box, that will also display adjust for default values on the form
8
by: kchayka | last post by:
<URL:http://www.w3.org/QA/Tips/font-size> In the "recommneded practices", I don't agree with their second bullet point, but the last 2 bullets sound like really bad advice, at least in a WWW...
0
by: RobbRoss | last post by:
I'm trying to adjust the font-size of my header. I can do that until I turn allowsorting=True, then no matter what I set for font-size it doesn't adjust. How can I adjust the header font-size when...
7
by: lauren quantrell | last post by:
A while back I got a requirement for the client to be able to adjust the relative heights of two subforms by click-dragging the mouse and I came up with a kludge solution using a border control...
4
by: Elijsh | last post by:
I'm new to datagrid and VB.Net. Is there any way to adjust the height of datagrid textbox row according to the height of text programmatically ? Your advice is greatly appreciated!
6
by: Scott Kilbourn | last post by:
Hi, I'm writing a control that inherits from TextBox. I need to adjust the width of this control based on the number of characters in the control. I'm having a hard time with this. The...
6
by: Christopher Glenn | last post by:
I have very basic html skills. My friend who has a wide screen monitor and is using IE7 sent me a jpg screen shot of my home page. I have attached this jpg, but I recall a while back that...
4
by: Terry | last post by:
I am trying to figure out if there is a way to get a regular asp.net TextBox to fill the screen, both height and width. When I drop a TextBox onto a blank asp.net page and set the height="100%",...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.