Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>Test Page</title>
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
  article, aside, figure, footer, header, hgroup, 
  menu, nav, section { display: block; }
  body {
    font-family: sans-serif;
  }
  p {
    margin: 0px;
  }
  #p1 {
    display: none;
  }
</style>
</head>
<body>
  
  <div id='c1'>This is c1
    <p id='p1'>This is p1</p>
  </div>
  <hr>
</body>
</html>
 
jQuery(function($) {
  var step = 3;
  
  $(document).ready(function() {
    switch (step) {
      case 0:
        display("Hiding p1");
        $("#p1").css("display", "none");
        break;
      case 1:
        display("Hiding c1");
        $("#c1").css("display", "none");
        break;
      case 2:
        display("Showing p1");
        $("#p1").css("display", "");
        break;
      case 3:
        display("Showing c1; done");
        $("#c1").css("top", "100");
        break;
    }
    ++step;
  });
  
  function display(msg) {
    $("<p/>").html(msg).appendTo(document.body);
  }
  
});
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers