/ Published in: jQuery
URL: https://www.travismathew.com/team/
Fades a title over the image
Expand |
Embed | Plain Text
<!-- CSS --> <style type="text/css"> .pgaPhoto { width: 283px; height: 300px; position: relative; display: block; margin-bottom: 24px; } .pgaTitle { width: 283px; height: 60px; background: url(../images/black2.png); position: absolute; left: 0px; top: 240px; } .pgaTitle h2 { font-family: Arial, Helvetica, sans-serif; font-size: 21px; color: #FFF; text-align: center; font-weight: normal; margin: 15px 0px 10px 0px; padding: 0px 0px 0px 0px; text-transform: none; border-bottom: none; } .pgaTitle h3 { font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: #999999; text-align: center; font-weight: normal; margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; } </style> <!-- SCRIPT --> <script type="text/javascript"> /* you need jquery too! */ $(document).ready(function() { $(".pgaPhoto").hover(function() { $(this).find(".pgaTitle").stop().fadeTo(300, 1 , function() { }); } , function() { //on hover out... $(this).find(".pgaTitle").fadeTo(300, 0); }); }); </script> <!-- HTML --> <a href="/team/bubba/"> <div class="pgaPhoto"> <div class="pgaTitle" style="display: none;"> <h2>Bubba Watson</h2> <h3>PGA Tour</h3> </div> <img src="/images/11team-bubba.jpg" width="283" height="300" /> </div> </a>
You need to login to post a comment.
