Advertisement
lalatino

slideup

Jul 23rd, 2013
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.47 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="description" content="">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title>Untitled</title>
  8. <style>
  9.  
  10. #showcaseClose {
  11.     background-image: url("_thework/allwork_showcase_close.png");
  12.     background-position: center center;
  13.     background-repeat: no-repeat;
  14.     cursor: pointer;
  15.     height: 27px;
  16.     position: absolute;
  17.     right: 16.5%;
  18.     top: 1685px;
  19.     width: 28px;
  20. }
  21.  
  22. #openWork img {
  23.     height: 500px;
  24.     left: 20%;
  25.     position: relative;
  26.     width: 500px;
  27.     border:1px solid #f88;
  28. }
  29.  
  30.  
  31. #firstBlockwrap {
  32.     width: 776px;
  33.     margin: 0 auto;
  34. }
  35.  
  36. ul.block {
  37.     height: 1635px;
  38.     margin: 0 0 40px;
  39.     max-width: 1081px;
  40.     overflow: hidden;
  41.     position: relative;
  42.     width: 100.2%;
  43. }
  44.  
  45. ul.block li {
  46.     background: none repeat scroll 0 0 #999999;
  47.     float: left;
  48.     overflow: hidden;
  49.     position: absolute;
  50. }
  51.  
  52. li.block1{ width: 190px; height: 166px; top: 0; left:0; }
  53. li.block2{ width: 190px; height: 255px; top: 0; left:25%; }
  54. li.block3{ width: 190px; height: 128px; top: 0; left:50%; }
  55.  
  56.  
  57. .openWorkWrapper{
  58.     background: rgba(0,0,0,.4);
  59.     width: 100%;
  60.     height: 700px;
  61. }
  62.  
  63. #main{
  64.     width: 960px;
  65.     margin: auto;
  66. }
  67.  
  68. </style>
  69. <link rel="author" href="humans.txt">
  70. </head>
  71. <body>
  72.  
  73. <div id="main">
  74. <div id="firstBlockwrap" class="block-wrap">
  75.  
  76. <ul class="block">
  77. <li id="mosaico" class="block3 shadow-inset">
  78.     <img width="190" height="128" alt="a-toda-hora" class="attachment-block_8 wp-post-image" src="images/portfolio/a-toda-hora.png">
  79. </li><!-- #post-2264 -->
  80.  
  81. <li id="mosaico" class="block2 shadow-inset">
  82.     <a href="images/portfolio/tu-me-lees.png" rel="prettyPhoto[gallery]" class="hoverstuff-zoom"><i class="icon-zoom-in"></i></a>
  83.     <a href="http://localhost/?myportfoliotype=2" class="hoverstuff-link"><i class="icon-link"></i></a>
  84.  
  85.     <div class="inside" style="opacity: 0;">
  86.         <h2><a href="http://localhost/?myportfoliotype=2">2</a></h2>
  87.     </div>
  88.     <img width="190" height="255" alt="tu-me-lees" class="attachment-block_8 wp-post-image" src="images/portfolio/tu-me-lees.png">
  89. </li><!-- #post-2263 -->
  90.  
  91.  
  92.  
  93. <li id="mosaico" class="block1 shadow-inset">
  94.     <a href="images/portfolio/terra.png" rel="prettyPhoto[gallery]" class="hoverstuff-zoom"><i class="icon-zoom-in"></i></a <a href="http://localhost/?myportfoliotype=1" class="hoverstuff-link"><i class="icon-link"></i></a>
  95.     <div class="inside" style="opacity: 0;">
  96.         <h2><a href="http://localhost/?myportfoliotype=1">1</a></h2>
  97.     </div>
  98.     <img width="190" height="166" alt="terra" class="attachment-block_6 wp-post-image" src="images/portfolio/terra.png">
  99. </li><!-- #post-2261 -->
  100. </ul>
  101.  
  102. <div class="openWorkWrapper" id="openWork">
  103.     <div id="showcaseClose">close</div>
  104. </div>
  105.  
  106. </div>
  107. </div>
  108.  
  109. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  110. <script>
  111.  
  112. $(document).ready(function(){
  113.     var $open = $('.openWorkWrapper'),
  114.     $img= $('#firstBlockwrap').find('img'),
  115.     $shCase = $('#showcaseClose'),
  116.     $ventana = $('html, body');
  117.     $open.hide();
  118.     $img.on('click', function(){
  119.         var $clicked = $(this);
  120.         $open.slideDown();
  121.         $clicked.clone().appendTo($open);
  122.         $ventana.animate({scrollTop:1600}, 300);
  123.        
  124.         if ($open.children().length > 2) {
  125.             $open.children().eq(1).remove();
  126.         };
  127.         console.log($open.children().length);
  128.     });
  129.     $shCase.on('click',function(){
  130.         $open.children().remove('img');
  131.         $open.slideUp();
  132.         $('html, body').animate({scrollTop:500}, 300);
  133.     });
  134. });
  135. </script>
  136. </body>
  137. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement