Tue, 2012-02-14 15:33
I am implementing a slide out type CSS style and it worked great when I used just one slideout
- element but when I added a second one to the page both are sliding out when I mouse over just one of the elements ( Even after I named the second one differently. The reason I am using CSS is because all of the jQuery slideout solutions place the element on the left or right of the browser and I needed one to slide out from a table. Here is the code for the slide out and CSS:
Slideouts
-----------------
<td valign="top" style="padding-top:10px;"> <ul class="navMap"> <li> <!--[if lte IE 6]><a class="ie6" href="#url"><table><tr><td><![endif]--> <ul class="subMap"> <li><a href="http://www.script-tutorials.com/"><img src="img/transparent.png" border="0" height="100px" width="200px" title="View Map" alt="View Map" /></a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> </ul> <ul class="navEngage"> <li> <!--[if lte IE 6]><a class="ie6" href="#url"><table><tr><td><![endif]--> <ul class="subEngage"> <li><a href="http://www.script-tutorials.com/"><img src="img/transparent.png" border="0" height="100px" width="200px" title="View Map" alt="View Map" /></a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> </ul> </td>
CSS
-------
/* main menu styles */ ul.navMap { list-style:none; height:200px; margin:0; padding:0; } ul.navMap table { border-collapse:collapse; width:0; height:0; margin:-1px 0 -5px -1px; } ul.navMap > li { float:right; height:240px; width:60px; position:relative; overflow:hidden; -webkit-transition-duration:.5s; -moz-transition-duration:.5s; -o-transition-duration:.5s; } * html ul.navMap > li { width:auto; } ul.navMap > li a.ie6 { float:right; height:230px; width:39px; position:relative; overflow:hidden; } ul.subMap { list-style:none; height:182px; width:366px; background:url(img/map_slideout.png) no-repeat left top; position:absolute; right:0; top:0; margin:0; padding:0; } ul.subMap li { float:left; } ul.subMap li:first-child { margin-left:45px; } ul.subMap li a { display:block; width:110px; height:182px; float:left; overflow:hidden; position:relative; text-decoration:none; color:#000; } ul.subMap li a b { font-weight:700; display:block; padding:15px 15px 5px; } ul.subMap li a p { font-size:12px; display:block; margin:0; padding:0 10px; } /*ul.sub li a i { display:block; width:64px; height:64px; position:absolute; right:10px; bottom:10px; background:url(img/post.png); opacity:0.1; filter:alpha(opacity = 10); -webkit-transition-duration:.5s; -moz-transition-duration:.5s; -o-transition-duration:.5s; }*/ ul.navMap > li:hover { width:270px; } ul.navMap > li a.ie6:hover { direction:ltr; width:270px; } ul.subMap li a:hover i { opacity:1.0; } /* Engage */ ul.navEngage { list-style:none; height:200px; margin:0; padding:0; } ul.navEngage table { border-collapse:collapse; width:0; height:0; margin:-1px 0 -5px -1px; } ul.navEngage > li { float:right; height:240px; width:60px; position:relative; overflow:hidden; -webkit-transition-duration:.5s; -moz-transition-duration:.5s; -o-transition-duration:.5s; } * html ul.navEngage > li { width:auto; } ul.navEngage > li a.ie6 { float:right; height:230px; width:39px; position:relative; overflow:hidden; } ul.subEngage { list-style:none; height:182px; width:366px; background:url(img/engage_slideout.png) no-repeat left top; position:absolute; right:0; top:0; margin:0; padding:0; } ul.subEngage li { float:left; } ul.subEngage li:first-child { margin-left:45px; } ul.subEngage li a { display:block; width:110px; height:182px; float:left; overflow:hidden; position:relative; text-decoration:none; color:#000; } ul.subEngage li a b { font-weight:700; display:block; padding:15px 15px 5px; } ul.subEngage li a p { font-size:12px; display:block; margin:0; padding:0 10px; } /*ul.sub li a i { display:block; width:64px; height:64px; position:absolute; right:10px; bottom:10px; background:url(img/post.png); opacity:0.1; filter:alpha(opacity = 10); -webkit-transition-duration:.5s; -moz-transition-duration:.5s; -o-transition-duration:.5s; }*/ ul.navEngage > li:hover { width:270px; } ul.navEngage > li a.ie6:hover { direction:ltr; width:270px; } ul.subEngage li a:hover i { opacity:1.0; }