javascript - Sliding box with caption -
i have sliding boxcaption , works fine. when first view has box caption on , when mouse on works starts off caption on top. , want box caption show when user mouses on box. cant figure out why that. it's kind of odd.
take @ here can see talking about.
http://ironbulldog.com/windows/test.html
below source code.
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>testing</title> <style type="text/css"> *{ padding:0px; margin:0px; } body{ background:#d5dee7; } a{ color:#c8dce5; } h3{ margin: 190px 10px 0 10px; color:#fff; font:18pt arial, sans-serif; letter-spacing:-1px; font-weight: bold; } .boxgrid{ width: 325px; height: 260px; margin:10px; float:left; background:#161613; border: solid 2px #8399af; overflow: hidden; position: relative; } .boxgrid img{ position: absolute; top: 0; left: 0; border: 0; } .boxgrid p{ padding: 0px 10px; color:#afafaf; font-weight:bold; font:10pt "lucida grande", arial, sans-serif; } .boxcaption{ float: left; position: absolute; background: #000; height: 260px; width: 100%; opacity: .8; /* ie 5-7 */ filter: progid:dximagetransform.microsoft.alpha(opacity=80); /* ie 8 */ -ms-filter: "progid:dximagetransform.microsoft.alpha(opacity=80)"; } </style> <script type="text/javascript" src="http://www.microsoft.com/library/shared/jquery/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ //to switch directions up/down , left/right place "-" in front of top/left attribute //vertical sliding $('.boxgrid.slidedown').hover(function(){ $(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300}); }, function() { $(".cover", this).stop().animate({top:'260px'},{queue:false,duration:300}); }); //header text comes in later $('.boxgrid.slidedown').hover(function(){ $(".delay", this).stop().animate({top:'0px'},{queue:false,duration:500}); }, function() { $(".delay", this).stop().animate({top:'260px'},{queue:false,duration:500}); }); }); </script> </head> <body> <div class="boxgrid slidedown"> <img src="jareck.jpg"/> <div class="cover boxcaption"> <div class="delay boxcaption"> <h3>the nonsense society</h3> </div> </div> </div> </body> </html>
add line css
.boxcaption.cover { top: 260px; }
Comments
Post a Comment