<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>
'개발 > jQuery' 카테고리의 다른 글
jquery vticker (vertical news ticker) - 위로 올라가는 뉴스티커 (0) | 2010.08.17 |
---|---|
select (combo) box (0) | 2010.08.12 |
플러그인 만들기 (0) | 2010.08.06 |
jQuery를 이용해 가시 영역의 이미지만 로딩하는 기법 (0) | 2010.06.16 |
jQuery를 이용한 로딩 중 이미지 표시(update) (0) | 2010.06.16 |