473,788 Members | 2,868 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IE <DIV> layer and z-index question

I got a little problem, maybe You could help me out.

I have one layer that is used to darken all content on page (opacity
50%) to make other layer more visible.

If i show two separate Layers - darkenLayer with z-index:1, and a
other layer with z-index:2 - everything is ok. But i would like to do
something like this:

<DIV id="darken"></DIV>

<DIV id="someDIV">

<TABLE><TR><T D>
<DIV id="someChildDI V"blablalbal

<DIV id="doNotDarken ThisDiv" IMPORTANT DIV</DIV>

</DIV>

</TD></TR></TABLE>
</DIV>
My question is - how to make a DIV - doNotDarkenThis Div to be over the
darken DIV. I tried set higher z-index for doNotDarkenThis Div however
this do not solved problem. I read a few pages, looking alot on google
and still haven't got any clues. In my case 'darken' DIV have to be
position:absolu te, and 'someDIV' too...... Help!
Feb 11 '08 #1
13 5760
SAM
wilq a écrit :
I got a little problem, maybe You could help me out.

I have one layer that is used to darken all content on page (opacity
50%) to make other layer more visible.

If i show two separate Layers - darkenLayer with z-index:1, and a
other layer with z-index:2 - everything is ok. But i would like to do
something like this:

<DIV id="darken"></DIV>

<DIV id="someDIV">

<TABLE><TR><T D>
<DIV id="someChildDI V"blablalbal
blablabal must be in a <p>aragraph
<DIV id="doNotDarken ThisDiv" IMPORTANT DIV</DIV>

</DIV>

</TD></TR></TABLE>
</DIV>
My question is - how to make a DIV - doNotDarkenThis Div to be over the
darken DIV. I tried set higher z-index for doNotDarkenThis Div however
this do not solved problem.
that doesn't work this way ...

With the code above as the darken is coded in first, this one is bellow
all what follow

So ... no problem, the notDarken (and its table contener) are not darken

Give a background color to your 'notDarken'

--
sm
Feb 11 '08 #2
On Feb 11, 8:18*pm, SAM <stephanemoriau x.NoAd...@wanad oo.fr.invalid>
wrote:
wilq a écrit :
I got a little problem, maybe You could help me out.
I have one layer that is used to darken all content on page (opacity
50%) to make other layer more visible.
If i show two separate Layers - darkenLayer with z-index:1, and a
other layer with z-index:2 - everything is ok. But i would like to do
something like this:
<DIV id="darken"></DIV>
<DIV id="someDIV">
* *<TABLE><TR><TD >
* * <DIV id="someChildDI V"blablalbal

blablabal must be in a <p>aragraph
* * * * *<DIV id="doNotDarken ThisDiv"*IMPORT ANT DIV</DIV>
* *</DIV>
* *</TD></TR></TABLE>
</DIV>
My question is - how to make a DIV - doNotDarkenThis Div to be over the
darken DIV. I tried set higher z-index for doNotDarkenThis Div however
this do not solved problem.

that doesn't work this way ...

With the code above as the darken is coded in first, this one is bellow
all what follow

So ... no problem, the notDarken (and its table contener) are not darken

Give a background color to your 'notDarken'

--
sm
I mean that all DIV-s got own backgrounds. Darken one got black
background with opacity 50%, someDiv have no color, TABLE and its
components got white backgrounds, and DIV doNotDarkenThis Div have gray
background. I would like to show Darken DIV that would be over other
layers except the "doNotDarkenThi sDiv" and here comes a problem :
( Here is complete code for this example:

<html>
<head>
<style type="text/css">
#darken {
background-color : black ;
opacity: 0.5 ;
position : absolute ;
filter : alpha(opacity=5 0) ;
width : 150;
height : 150 ;
z-index : 11 ;

}
#someDiv
{
position:absolu te;
z-index:10;
}
#someChildDIV
{
position:absolu te;
}

#doNotDarkenThi sDiv
{
background-color : WHITE ;
z-index:23;
}
</style>
</head>
<body>
<DIV id="darken"></DIV>
<DIV id="someDIV">
<TABLE><TR><T D>
<DIV id="someChildDI V"Some text
<DIV id="doNotDarken ThisDiv" IMPORTANT DIV</DIV>
</DIV>
</TD></TR></TABLE>
</DIV>
</body>
</html>

I would like to 'doNotDarkenThi sDiv' be over the 'darken' div (so
background of doNotDarken... should be white, but it's not (in IE)).
Anyyone know any solution for that?
Feb 11 '08 #3
SAM
wilq a écrit :
>
I mean that all DIV-s got own backgrounds. Darken one got black
background with opacity 50%,
but ... what you did seems to work (in Fx) :

<html>
<head>
<style type="text/css">
#darken {
background-color : black ;
position : absolute ;
filter : alpha(opacity=5 0) ;
-moz-opacity: 0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
width : 150;
height : 150 ;
/*
z-index : 11 ;
*/

}
#someDiv
{
position:absolu te;
z-index:10;
}
#someChildDIV
{
position:absolu te;
}

#doNotDarkenThi sDiv
{
background-color : WHITE ;
/*
z-index:23;
*/
}
</style>
</head>
<body>
<DIV id="darken"></DIV>
<DIV id="someDIV">
<TABLE><TR><T D>
<DIV id="someChildDI V"Some text
<DIV id="doNotDarken ThisDiv" IMPORTANT DIV</DIV>
</DIV>
</TD></TR></TABLE>
</DIV>
</body>
</html>
Feb 12 '08 #4
Hmm it work's in FF in IE 6.0 but not in IE 7.0 ?? hmmm but its not my
problem ehh:/ I have to make a proper sample again. Grr..
Feb 12 '08 #5
SAM
wilq a écrit :
Hmm it work's in FF in IE 6.0 but not in IE 7.0 ?? hmmm but its not my
problem ehh:/ I have to make a proper sample again. Grr..
And with only :
#darken {
background-color : #888;
}

Why to work with opacity with a div in rear of layout ?

--
sm
Feb 12 '08 #6
On Feb 12, 3:05*pm, SAM <stephanemoriau x.NoAd...@wanad oo.fr.invalid>
wrote:
wilq a écrit :
Hmm it work's in FF in IE 6.0 but not in IE 7.0 ?? hmmm but its not my
problem ehh:/ I have to make a proper sample again. Grr..

And with only :

#darken {
* * * * *background-color : #888;
* * * * *}

Why to work with opacity with a div in rear of layout ?

--
sm
First of all: The script do not works in IE 7.0 (but in fact mine
problem ocurres in IE 6.0 so now im trully confused ;))). Second: I
want a darkening div as i presented there - i mean that I need to
darken all context on page and to shop a "popup", but ocasionally i
want to "do not darken" few elements of context. In my logic (maybe
wrong logic) setting a z-index for element of darkened context should
make them to be not darken but it dont work. ;( ech...
Feb 12 '08 #7
Thanks for reply! I have bad news :( It's still not working in IE. It
working in FF, but the code i presented before works in FF too so
nothing changes :( Any other ideas? I found a site about IE bug, but i
cant find any workaround ... :( here it is: http://aplus.co.yu/lab/z-pos/

Feb 13 '08 #8
Ok i found a first workaround:

Setting z-index of parent element higher than a darkening element,
then gives all content lower z-index makes it show properly. Here is
code:

<html>
<head>
<style type="text/css">
#darken {
background-color : black ;
opacity: 0.5 ;
position : absolute ;
filter : alpha(opacity=5 0) ;
width : 150;
height : 150 ;
z-index : 11 ;

}
#someDiv
{
position:absolu te;
z-index:12; <---- notice here
}
#someChildDIV
{
position:absolu te;
z-index : 10 ; <---- notice here
}

#doNotDarkenThi sDiv
{
background-color : WHITE ;
z-index:23;
}
</style>
</head>
<body>
<DIV id="darken"></DIV>
<DIV id="someDIV">
<TABLE><TR><T D>
<DIV id="someChildDI V"Some text
<DIV id="doNotDarken ThisDiv" IMPORTANT DIV</DIV>
</DIV>
</TD></TR></TABLE>
</DIV>
</body>
</html>
Feb 13 '08 #9
SAM
wilq a écrit :
>
It seems that setting z-index via css do not sets style.zIndex for
object
CSS style any objets you gave to them to style, and even z-index.

But it is very right, the JS can only get JS styles
(style attribute of object)

you'ld need :

<DIV id="darken" style="z-index:25"></DIV>

to know on witch z-index 'darken' is set
(probably you could inspect Rules too but it is more difficult)
workaround for that problem is manually set z-index via style.zIndex
on "onload".
Why that ?

--
sm
Feb 14 '08 #10

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

Similar topics

1
2510
by: Philo | last post by:
How do I select all <div> tags except those which contain a <table> tag somewhere within them? Example XML: <********************** sample input ***********************> <txtSectionBody> <div> <span>
4
5052
by: Ian Rastall | last post by:
This really is a JavaScript question. I have a site that looks fine in everything but NN4. I'm afraid I don't have a URL, because the site is very much unfinished. The site is a header (which is a table) and a main <div> underneath that. The main <div> is set to have a top margin of 3%, which works fine, except in NN4. There, it looks like it has a margin of 20%, or even larger. I couldn't fix it with the @import hack, so I thought I...
3
2250
by: Craig | last post by:
Hi, What I'm trying (quite poorly) to do is make it so when a link is clicked the text inside a div or p changes. I've tried numerous things, most of which work in IE but none of which work in gecko browsers e.g. Mozilla, Netscape, Epiphany etc etc. This is what I have now and works fine in IE but sits there doing nothing in anything else:
8
14467
by: Daniel Hansen | last post by:
I know this must seem totally basic and stupid, but I cannot find any reference that describes how to control the spacing between <p>...</p> and <div>...</div> blocks. When I implement these on a page, there is a huge gap (like 3/8 inch or 25 px) between them. This is driving me bananas. What the hey am I missing? dh ------------------------------------------------ Dan Hansen ------------------------------------------------
19
4478
by: benzwt | last post by:
I use the following function to hide a <div> named one. function hideObject() { if (ns4) { document.n1.visibility = "hide"; } else if (ie4) { document.all.style.visibility = "hidden"; } else if (nn6) {
4
5105
by: Bruce W...1 | last post by:
IE 6 supports the DOM for the most part. Am I missing something or is this absent from Visual Studio 2003? Does Web Matrix have it? You see, I'm trying to get Visual Studio and Dreamweaver MX to play together nicely. And with html tables they do. So I thought I'd try some layers instead of tables. I created some layers in Dreamweaver then in VS put in some ASP.NET hyperlink, but then Dreamweaver wouln't let me edit the layer...
1
1523
by: Shinya Koizumi | last post by:
Have you seen the example of how to make a modeless layer using <div>? SK
3
1985
by: chris1606 | last post by:
I have an image gallery that pops up an enlarged version of a picture when someone clicks on it. That bit works, but it should also load the picture's caption into the floating layer. Instead the caption remains unchanged and gives an "object doesn't support this property or method" dialog. The code is as follows: <script> function goBig(objNo, caption) { document.getElementById('floatdiv').style.visibility = 'visible'; ...
1
19459
by: Lee99 | last post by:
Hey guys, Love the forum. Been browsing a lot, now time for my first post :-) I'm wondering how to set a <div> tag to be center aligned to the screen, both horizontally and vertically... so it's slap-bang dead-center in the middle of the screen. I'm creating a floating <div> layer that acts as a pop-up (before I get pounced on by you anti-pop-up crowd, it's not what you think -- it's perfectly contextually relevant to what it'll be used...
2
3388
by: Richard Maher | last post by:
Hi, I'm trying to use the Visibility Style attribute for a Div to effectively PopUp a lightweight window with some additional context-sensitive information, when a user mouses over a given field(s). The popping-up seems to work just fine; it's the tearing down that's giving me grief. If I stick a onmouseout event on the same input field that caused the onmouseover/pop-up, it starts to flicker 'cos the <divis placed for esthetically...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10366
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3675
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.