RishiShreshtha

slideTop

Apr 23rd, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.24 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>jQuery Image Captions Tutorial | alijafarian.com</title>
  5. <style type="text/css">
  6. * {
  7.     margin: 0;
  8.     padding: 0;
  9. }
  10. body {
  11.     font-family: Arial, Helvetica, sans-serif;
  12.     font-size: 100%;
  13.     color: #666;
  14. }
  15. #wrapper {
  16.     margin: 20px auto;
  17.     width: 960px;
  18. }
  19. h1 {
  20.     text-align: center;
  21.     margin: 0 0 20px;
  22. }
  23. .grid-block-container {
  24.     float: left;
  25.     width: 990px;
  26.     margin: 20px 0 0 -30px;
  27. }
  28. .grid-block {
  29.     position: relative;
  30.     float: left;
  31.     width: 300px;
  32.     height: 200px;
  33.     margin: 0 0 30px 30px;
  34. }
  35. .grid-block h4 {
  36.     font-size: .9em;
  37.     color: #333;
  38.     background: #f5f5f5;
  39.     margin: 0;
  40.     padding: 10px;
  41.     border: 1px solid #ddd;
  42. }
  43. .caption {
  44.     display: none;
  45.     position: absolute;
  46.     bottom: 0;
  47.     left: 0;
  48.     background: url(images/trans-black-50.png);
  49.     width: 100%;
  50.     height: 100%;
  51. }
  52. .caption h3, .caption p {
  53.     color: #fff;
  54.     margin: 20px;
  55. }
  56. .caption h3 {
  57.     margin: 20px 20px 10px;
  58. }
  59. .caption p {
  60.     font-size: .75em;
  61.     line-height: 1.5em;
  62.     margin: 0 20px 15px;
  63. }
  64. .caption a.learn-more {
  65.     padding: 5px 10px;
  66.     background: #08c;
  67.     color: #fff;
  68.     border-radius: 2px;
  69.     -moz-border-radius: 2px;
  70.     font-weight: bold;
  71.     text-decoration: none;
  72. }
  73. .caption a.learn-more:hover {
  74.     background: #fff;
  75.     color: #08c;
  76. }
  77. </style>
  78. </head>
  79.  
  80. <body>
  81. <div id="wrapper">
  82.   <div class="grid-block-container">
  83.    
  84.     <!--/.grid-block-->
  85.    
  86.     <!--/.grid-block-->
  87.    
  88.     <div class="grid-block slide"> <img src="http://crossfiremedia.realpage.com/voyageratthespace/photos/ph1065_w1050_h174.png" />
  89.       <div class="caption">
  90.         <h3>Caption Title</h3>
  91.         <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
  92.         <p><a href="#" class="learn-more">Learn more</a></p>
  93.       </div>
  94.     </div>
  95.     <!--/.grid-block-->
  96.    
  97.   </div>
  98.   <!--/.grid-container-->
  99.  
  100. </div>
  101. <!--/.wrapper-->
  102.  
  103. <!---------- JS ---------->
  104. <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  105. <script type="text/javascript">
  106. jQuery(document).ready(function($) {
  107.     $('.slide').hover(function () {
  108.         $(this).children('.caption').slideToggle(250);
  109.     });
  110. });
  111. </script>
  112. </body>
  113. </html>
Advertisement
Add Comment
Please, Sign In to add comment