首页javascriptimgjQuery HTML Element - 如何句柄图像加载事件...

jQuery HTML Element - 如何句柄图像加载事件...

我们想知道如何句柄图像加载事件。...

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.10.1.js'></script>
<style type='text/css'>
#load {
  position: fixed;
  background: #EEE;
  opacity: 0.5;
  left: 22px;
  top: 0px;
  width: 100%;
  height: 100%;
  display: none;
}
</style>
<script type='text/javascript'>//<![CDATA[ 
$(window).load(function(){
     $("form").submit(function(){
        $("#load").show();
     });
});//]]>  
</script>
</head>
<body>
  <form action="" method="post">
       <input type="Submit" value="submit">
  </form>
  <div id="load">
    <img src="http://www.w3cschool.cn/style/download.png" />
  </div>
</body>
</html>