Jquery Mobile 捲軸到底 並執行
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js"></script>
<script type="text/javascript">
$(function () {
$(document).on("scrollstart", function () {
if ($(window).scrollTop() + $(window).height() == $(document).height()) {
//捲軸到底後會執行
$("#content").clone().appendTo($("#content"));
}
});
});
</script>
<body>
<div id="terms" style='overflow:auto;'>
<div data-role="page">
<div data-role="header">
<h1>silentScroll() example</h1>
</div>
<div id="content" role="main" class="ui-content">
<a href="#" onclick="" data-role="button">Go down 100 pixels</a>
<p> <br><br>Here, we have some text so that we can have <br>
some vertical space in order to demonstrate <br>
the silentScroll() method.<br><br></p>
<a href="#" onclick="$.mobile.silentScroll(0)" data-role="button">Back to Top</a>
</div>
<div data-role="footer">
<h4> </h4>
</div>
</div>
</div>
</body>
標籤: Jquery, Jquery Mobile
0 個意見:
張貼留言
訂閱 張貼留言 [Atom]
<< 首頁