Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<meta charset=utf-8 />
<title>Loading overlay</title>
<style>
  * { margin:0; padding:0; }
  body { padding: 30px; }
  table { width:500px; height:500px; padding:20px; background:#f1f1f1; color:#000;  border:1px solid #ccc; }
  
  #overlay { 
    display:none; 
    position:absolute; 
    background:#fff; 
  }
  #img-load { 
    position:absolute; 
  }
  
</style>
</head>
<body>
  
  <p><i>Hover over the table to see how loading looks</i></p>
  
  <table id="table"> <tr><td>table</td></tr> </table>
  <div id="overlay">
    <img src="http://i59.tinypic.com/mm6691.gif" id="img-load" />
  </div>
</body>
</html>
 
$t = $("#table");
$("#overlay").css({
  opacity: 0.5,
  top: $t.offset().top,
  width: $t.outerWidth(),
  height: $t.outerHeight()
});
$("#img-load").css({
  top:  ($t.height() / 2),
  left: ($t.width() / 2)
});
$t.mouseover(function(){
   $("#overlay").fadeIn();
});
Output

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

Dismiss x
public
Bin info
galambalazspro
0viewers