>  기사  >  웹 프론트엔드  >  Jquery 스크롤 막대 이벤트의 간단한 예

Jquery 스크롤 막대 이벤트의 간단한 예

PHPz
PHPz앞으로
2016-05-16 17:28:541485검색

이 기사에서는 jquery 스크롤바 이벤트의 간단한 예를 소개합니다. 도움이 필요한 친구는 이를 참고할 수 있습니다.

코드는 다음과 같습니다.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="jquery-1.6.2.js"></script>
<script type="text/javascript">
$(function(){
var lazyheight = 0; 
//获取数据
function showload(){ 
lazyheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop()); 
if ($(document).height()-100 <= lazyheight) { 
alert("xxx");
} 
} 
//showload();
//绑定事件
$(window).bind("scroll", function(){ 
//当滚动条滚动时
showload();
}); 
})
</script>
</head>
<body>
<img src="82938048_46374805.jpg"/>
<img src="82938048_46374805.jpg"/>
<img src="82938048_46374805.jpg"/>
</body>
</html>

더 많은 관련 튜토리얼을 보려면 다음 페이지를 방문하세요. jQuery 동영상 튜토리얼

성명:
이 기사는 jb51.net에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제