PicDiv

by Koubenec

HTML

<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  
  
  
 <div class="item">
    <div class="item-billboard">
      <span class="caption">View Document</span>
    </div>
    <div class="item-detail">
        <div class="tophalfdiv" onclick = "top.location.href='http://www.google.com'"><span class = "center">Download PDF</span></div><div class="btmhalfdiv"><span class="center">View HTML</span></div>
    </div>
</div>

</body>
</html>

CSS

.item {
  position: relative;
  width: 130px;
  overflow: hidden;
  border: 0px solid #ccc;
  float: left;
}
  .item {
    height: 130px;
  }
  
  .item a {
    text-decoration: none;
    color: #000;
  }
  
  .item-billboard, .item-detail {
    padding: 10px;
    height: 180px;
  }
  
  .item-billboard {
    margin-top: 0;
    background: #DC2D1A;
    background-image: url(http://wacaustin.org/wp-content/uploads/2012/09/Document_130px2.png);
    background-repeat: no-repeat;
  }

  .center { 
    line-height: 65px;
}
    
    .item-billboard h3 {
      font-size: 13px;
      font-weight: bold;
      color: #262626;
      font-family: "Open Sans", arial, sans-serif;
    }
  
  .item-detail {
    background: #ececec;
  }

.caption {
  position: absolute;
  bottom: 10px;
  left: 15px;
  color: #fff;
}

.detailbottom {
  position: relative;
  top: 25px;
  left: 23px;
  color: #fff;
}

.tophalfdiv {
  width: 130px;
  height: 65px;
  text-align: center;
  background-color: #FFE0E8;
  margin-left: -10px;
  margin-top: -10px;
  padding: 0px 0px 0px 0px;
  border-bottom: 1px solid #fff;
  color: #DC2D1A;
}

.tophalfdiv:hover {
  width: 130px;
  height: 65px;
  background-color: #DC2D1A;
  margin-left: -10px;
  margin-top: -10px;
  border-bottom: 1px solid #fff;
  cursor: pointer;
    color: #FFE0E8;
}

.btmhalfdiv {
  width: 130px;
  height: 65px;
  background-color: #FFE0E8;
  margin-left: -10px;
  margin-bottom: -10px;
  color: #DC2D1A;
  text-align: center;
}

.btmhalfdiv:hover {
  width: 130px;
  height: 65px;
  background-color: #DC2D1A;
  margin-left: -10px;
  margin-bottom: -10px;
  border-bottom: 1px solid #fff;
  color: #FFE0E8;
  cursor: pointer;
}

JavaScript

(function($){ // remap '$' to jQuery
$(function(){ // document ready
    
  $('.item').on('mouseenter mouseleave',function(e){
    $(this).stop().animate({scrollTop: e.type=='mouseenter'?200:0 },400);    
  });

});
})(jQuery);