-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJQ事件
78 lines (73 loc) · 2.59 KB
/
JQ事件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
1,jQuery pagecreate事件。
2,jQuery on()事件用于添加事件处理程序。
$(document).on("pagecreate","类,id,标签",function(){
jQuery Mobile点击事件。
});
3,tap事件用户点击某个元素触发
$("").on("tap",function(){
$(this).hide();
})。
4,taphold某个事件用户点击超过1秒以上。
$("").on("taphold",function(){
$(this).hide();
})
5,swipe事件在某个元素上滑动超过30px
$("").on("swipe",function(){
$(this).hide();
})
5.1swipeleft向左滑动超过30px
$(document).on("pagecreate","#id",function(){
$("").on("swipeleft",function(){
alert("");
});
})
5.2swiperight向右滑动超过30px
$(document).on("pagecreate","#id",function(){
$("").on("swiperight",function(){
alert("");
})
})
jQuery Mobiled滚动事件。
滚动开始
1.$(document).on("scrollstart",function(){
alert("");
})
,滚动结束。
$(document).on("scrollend",function(0{
alert("");
})
jQuery Mobiled方向事件
$(window).on(orientationchange",function(e){
alert("方向是:" + e.orientation);
});
)
portrait(设备被握持的方向是垂直的)
landscape(设备被握持的方向是水平的)
jQuery Mobile页面事件
$(document).on("pageinit",function(){
alert("触发 pageinit 事件 - 页面已初始化,DOM 已加载,jQuery Mobile 已完成页面增强。")
});
$(document).on("pagebeforecreate",function(){
alert("触发 pagebeforecreate 事件 - 页面即将初始化。jQuery Mobile 仍未开始增强页面。");
});
$(document).on("pagecreate",function(){
alert("触发 pagecreate 事件 - 已创建页面,但增强未完成。");
$(document).on("pageload",function(event,data){
alert("触发 pageload 事件!\nURL: " + data.url);
});
$(document).on("pageloadfailed",function(event,data){
alert("抱歉,被请求页面不存在。");
});
$(document).on("pagebeforeshow","#pagetwo",function(){
alert("触发 pagebeforeshow 事件 - 页面二即将显示");
});
$(document).on("pageshow","#pagetwo",function(){
alert("触发 pageshow 事件 - 现在显示页面二");
});
$(document).on("pagebeforehide","#pagetwo",function(){
alert("触发 pagebeforehide 事件 - 页面二即将隐藏");
});
$(document).on("pagehide","#pagetwo",function(){
alert("触发 pagehide 事件 - 现在隐藏页面二");
});
});