I'm using this div fadeTo code from here, which fades one of two divs, depending on hover.
What I'd like to do it add a third option - and a third div called #maindiv - in this way: "If hovering over #maindiv, don't fade either #sidebar or #primarycontainter, but if hovering over #sidebar or #primarycontainter, then fade either of those (depending on hover), but don't fade #maindiv."
How would I do that (with another else statement?) while keeping the existing else statement that keeps IE6 from using any of the code? Thanks....
Edit 2/3/10: Is there a different method of handling this because of the three divs? Is a callback needed, or someway to refresh the function, as the code below results in inconsistent fadeTo action?
$(document).ready(function(){
if ($.browser.version = jQuery.browser.msie &&
parseInt(jQuery.browser.version) == 6) {
} else {
$("#sidebar").fadeTo('fast', 0.5);
$("#sidebar").hover(function(){
$(this).stop().fadeTo('fast', 1);
$("#primarycontainer").stop().fadeTo('fast', 0.5);
},function(){
$(this).stop().fadeTo('fast', 0.5);
$("#primarycontainer").stop().fadeTo('fast', 1);
}
);
}
});
Edit 2/09/10:
Ed Woodcock's answer below works, with a slight modification (of my choosing) in my comments to his answer.
This is the CSS in question:
<body>
<div id="outerdiv" div style="position: relative;">
<div id="maindiv" div style="position:relative;">Lorem ipsum dolor sit amet.</div>
<div id="content">
<div id="primary" div style="float: left; margin-right: -20.0em; width: 100%;">
<div id="primarycontainer" div style="margin-right: 16.0em;">
<p>Lorem ipsum dolor sit amet.<p>
</div></div>
<div id="sidebar" div style="float: right; width: 15.0em;">Lorem ipsum dolor sit amet.</div>
</div></div>
</html>
</body>