I have two navigational elements that are set up as columns on either side of an image. You can see them in place at my website, here. Click on any image and after it loads, hover over it.
What I'm trying to accomplish is as follows:
- When the cursor is outside of the image, both nav buttons are set at 0% opacity.
- When the image is hovered in the center (not over either of the two nav buttons), both nav buttons are set at 50% opacity.
- When either nav button is hovered directly, it is set at 100% opacity and the other nav button is set at 0% opacity.
This isn't working at the moment. HTML is as follows:
<div id="sb-body">
<a id="sb-nav-previous" class="sb-bignav" title="Previous" onclick="Shadowbox.previous()"></a>
<a id="sb-nav-next" class="sb-bignav" title="Next" onclick="Shadowbox.next()"></a>
<div id="sb-body-inner">
<img style="position: absolute;" src="Corrosion.jpg" id="sb-player" height="405" width="609">
</div>
</div>
And CSS is as follows:
#sb-nav-next {
right:0;
background:url('../images/nav-right.png') center center no-repeat;
}
#sb-nav-previous {
left:0;
background:url('../images/nav-left.png') center center no-repeat;
}
#sb-body:hover .sb-bignav {
opacity:0.5;
-webkit-opacity:0.5;
-moz-opacity:0.5;
}
#sb-nav-next:hover #sb-nav-previous,
#sb-nav-previous:hover #sb-nav-next {
opacity:0;
-webkit-opacity:0;
-moz-opacity:0;
}
.sb-bignav {
cursor:pointer;
position:absolute;
width:200px;
height:100%;
top:0;
z-index:400;
opacity:0;
-webkit-opacity:0;
-moz-opacity:0;
transition: opacity .125s ease-in;
-webkit-transition: opacity .125s ease-in;
-moz-transition: opacity .125s ease-in;
}
.sb-bignav:hover {
opacity:1.0;
-webkit-opacity:1.0;
-moz-opacity:1.0;
}