Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Spry Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
#container {
position:relative;
width:700px;
height:570px;
}
.details {
width:500px;
height:200px;
left:100px;
top:100px;
background-color:yellow;
display:none;
position:absolute;
font-size: 1em;
}
#targetID {
position:absolute;
width:700px;
height:500px;
background-color:green;
top:70px;
}
</style>
<script type="text/javascript" src="http://7079.net/Spry/SpryEffects.js"></script>
<script type="text/javascript">
function fadeOut(){
var effect = new Spry.Effect.Opacity("targetID", 1, 0.2, {duration: 300, toggle: false});
effect.start();
}
function fadeIn(){
var effect = new Spry.Effect.Opacity("targetID", 0.2, 1, {duration: 300, toggle: false});
effect.start();
}
function displayDetails(trgt) {
var effect = new Spry.Effect.Opacity(trgt, 0, 1, {duration: 300, toggle: false});
effect.start();
document.getElementById(trgt).style.zIndex=10000;
}
function closeDetails(trgt) {
var effect = new Spry.Effect.Opacity(trgt, 1, 0, {duration: 300, toggle: false});
effect.start();
document.getElementById(trgt).style.zIndex='';
}
</script>
</head>
<body>
<div id="container">
<div id="targetID"></div>
<h3><a href="#" onclick="displayDetails('targetID2'); fadeOut();return false;">Click Me1</a></h3>
<h3><a href="#" onclick="displayDetails('targetID3'); fadeOut();return false;">Click Me2</a></h3>
<div class="details" id="targetID2"><a href="#" onclick="closeDetails('targetID2'); fadeIn();return false;">close1</a>
<p>This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test.
This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test.
This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test. </p>
</div>
<div class="details" id="targetID3"><a href="#" onclick="closeDetails('targetID3'); fadeIn();return false;">close2</a>
<p>This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test.
This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test.
This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test. This is a test, this is only a test. </p></div></div></body></html>
Notes: I'm not at all familiar with Spry. But I guessed (apparently correctly) that fade wasn't the same thing as opacity. I also guessed (apparently correctly) that IE would need a z-index component to show on top and not get confused about what was where in the stack. The one thing I was certain of was that all the stacked items should probably be positioned absolutely and independently within a relatively positioned container. There are other ways to work that out, but the way you had it with:
HTML Code:
<div id="targetID">
containing the details, no. Opacity and other styles that govern whether something can be seen or not are inherited from the parent, regardless of how they are set for the child.
Bookmarks