实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<link rel="stylesheet" href="https://apps.bdimg.com/libs/jquerymobile/1.4.2/jquery.mobile.min.css">
5
<script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
6
<script src="https://apps.bdimg.com/libs/jquerymobile/1.4.2/jquery.mobile.min.js"></script>
7
<script>
8
$(document).on("pageinit","#pageone",function(){
9
  $(document).on("scrollstart",function(event){
10
    $("span.test").html("Started to scroll on a " + event.target.nodeName + " element.");
11
    $("span.test2").html("Event triggered: " + event.type);
12
  });                       
13
});
14
</script>
15
</head>
16
<body>
17
18
<div data-role="page" id="pageone">
19
  <div data-role="header">
20
    <h1>The scrollstart Event</h1>
21
  </div>
22
23
  <div data-role="content">
24
    <p>Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..</p>
25
    <span class="test" style="color:blue;"></span>
26
    <br><br>
27
    <span class="test2" style="color:red;"></span>
28
  </div>
29
30
  <div data-role="footer">
31
    <h1>Footer Text</h1>
32
  </div>
33
</div> 
34
35
</body>
36
</html>