<html>
<head>
 <script language="javascript" src="/js/jquery-1.4.2.min.js"></script>
 
 <script type="text/javascript">


$(function(){
  var top = jQuery("#a2").offset().top;
  alert(top);

  function check(){
   if($(window).scrollTop() + $(window).height() >= top) {
    $("#a1").html('<img src="/image/aa.jpg" />');
   }
  }

  $(window).scroll(check);
  check();
});

 

 </script>
 
</head>

<body>

<table width="100%">
 <tr>
  <td>
   <div id="a1" style="width:100%; height:800px; border:1px solid RED">aaa</div>
   
   <div id="a2" style="width:100%; height:800px; border:1px solid BLACK">
    <img src="/image/aa.jpg" />
   </div>
  
  </td>
 </tr>
</table>


</body>
</html>

+ Recent posts