Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <a href="javascript: void(0)" id="fadeIn">fadeIn</a><a href="javascript: void(0)" id="fadeOut">fadeOut</a>
  <div class="page1">
      <img src="http://i.imgur.com/BleOC.jpg">
  </div>
  <div class="page">
      <div class="bg"></div>
  </div>
</body>
</html>
 
function fadePages(num) {
  $(".page1").each(function(i){
    $(this).animate({
      opacity: num
    }, 1000*(i+1));
  });
  $(".page").each(function(i){
    $(this).animate({
      opacity: num
    }, 1000*(i+1));
  });
}
$("#fadeIn").click(function() {
  fadePages(1);
});
$("#fadeOut").click(function() {
  fadePages(0);
});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers