'Develop'에 해당되는 글 74건
- 더보기 2012.04.27
- 로딩메시지 보이기 감추기 2012.04.27
- 스크롤 최하단 도착 2012.04.27
<!DOCTYPE html>
<html>
<head>
<title>JQuery Mobile Page</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script>
<script type="text/javascript">
$(document).ready(init);
function init()
{
$("#btnShow").bind("tap", function ()
{
$.mobile.showPageLoadingMsg();
});
$("#btnHide").bind("tap", function ()
{
$.mobile.hidePageLoadingMsg();
});
}
</script>
</head>
<body>
<div data-role="page">
<div data-role="header" data-position="fixed">
<h1>Loading Message Method</h1>
</div>
<div data-role="content">
<a href="#" id="btnShow" data-role="button">showPageLoadingMsg()</a>
<a href="#" id="btnHide" data-role="button">hidePageLoadingMsg()</a>
</div>
<div data-role="footer" data-position="fixed">
<h1>Writer Mozi</h1>
</div>
</div>
</body>
</html>
<script>
function scrollEnd(){
var scrollHeight = document.compatMode=="CSS1Compat"? document.documentElement.scrollHeight : document.body.scrollHeight;
var clientHeight = document.compatMode=="CSS1Compat"? document.documentElement.clientHeight : document.body.clientHeight;
var ScrollTop = document.compatMode == "CSS1Compat"? document.documentElement.scrollTop : document.body.scrollTop;
var scrollPos = scrollHeight - ScrollTop;
if (clientHeight == scrollPos)
{
alert("끝!");
}
}
</script>
<Body onscroll=scrollEnd();>
<script type="text/javascript" src="jquery-1.2.6.pack.js"></script>
<script type="text/javascript">
$(window).scroll(function(){
if ($(window).scrollTop() == $(document).height() - $(window).height()){
alert("끝!");
}
});
});
</script>