Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!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>
  <h2>Click on the kitten!</h2>
  <div class="container">
    <img src="http://placekitten.com/g/300/200" />
    <div class="info-block">
      <p>Look at this cute kitten, he is really cute.</p>
    </div>
  </div>
</body>
</html>
 
.container {
  
  cursor: pointer;
  position: relative;
  overflow: hidden;
  
}
.info-block {
  
  background-color: rgba(255,255,255,0.5);
  padding: 20px;
  position: absolute;
  bottom: -70px;
  width: 100%;
  height: 30px;
  
}
 
jQuery(document).ready(function(){
  $('img').click(function(){
  
    if( $(this).siblings('.info-block').css('bottom') !== '0px' )
      $(this).siblings('.info-block').animate({bottom: 0}, 'fast');
    else
      $(this).siblings('.info-block').animate({bottom: '-70px'}, 'fast');
  
  });
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
sunyatasattvapro
0viewers