navBall.html
3.56 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<style>
.mj-float-nav{
z-index: 30;
}
</style>
<div id="navBox" class="mj-float-nav quickclose">
<div class="icon-dot js-mj-float-nav"></div>
<div class="nav-content">
<ul>
<li onclick="javascript:window.location.href='{:U('Index/index',array('stoid'=>$Think.request.stoid))}'">
<div class="titbox">
<img src="__STATIC__/images/navBall/index.png" style="width:17px;height: 15px;" />
<p>首页</p>
</div>
<div class="dis_vm"></div>
</li>
<li onclick="javascript:window.location.href='{:U('Goods/categoryList',array('stoid'=>$Think.request.stoid))}'">
<div class="titbox">
<img src="__STATIC__/images/navBall/search.png" style="width:15px;height: 15px;" />
<p>分类</p>
</div>
<div class="dis_vm"></div>
</li>
<li onclick="javascript:window.location.href='{:U('User/index',array('stoid'=>$Think.request.stoid))}'">
<div class="titbox">
<img src="__STATIC__/images/navBall/user.png" style="width:13px;height: 15px;" />
<p>我</p>
</div>
<div class="dis_vm"></div>
</li>
</ul>
</div>
</div>
<script type="text/javascript">
// var flag = false;
// var cur = {
// x: 0,
// y: 0
// }
// //bw,bh屏幕分辨率的宽高,navw移动球的宽度
// var nx, ny, dx, dy, x, y,bw,bh,navw;
// function down() {
// flag = true;
// var touch;
// if(event.touches) {
// touch = event.touches[0];
// } else {
// touch = event;
// }
// cur.x = touch.clientX;
// cur.y = touch.clientY;
// dx = navBox.offsetLeft;
// dy = navBox.offsetTop;
// }
//
// function move() {
// if(flag) {
// var touch;
// if(event.touches) {
// touch = event.touches[0];
// } else {
// touch = event;
// }
// nx = touch.clientX - cur.x;
// ny = touch.clientY - cur.y;
// x = dx + nx;
// y = dy + ny;
// if(x < 0) {
// x = 0;
// }
// if(y < 0) {
// y = 0;
// }
// //导航球的宽度
// navw=$("#navBox").width();
// //屏幕分辨率宽高
// bw=window.screen.width - navw;
// bh=window.screen.height - 47;
// if(navw>47){
// bw=window.screen.width-navw;
// }
// if(x >bw) {
// x = bw;
//
// }
// if(y > bh) {
// y = bh;
// }
// navBox.style.left = x + "px";
// navBox.style.top = y + "px";
//
// //阻止页面的滑动默认事件
// $("body").bind("touchmove", function(event) {
// event.preventDefault();
// });
// }
// }
// //鼠标释放时候的函数
// function end() {
// flag = false;
// $("body").unbind("touchmove");
// }
// var navBox = document.getElementById("navBox");
// navBox.addEventListener("mousedown", function() {
// down();
// }, false);
// navBox.addEventListener("touchstart", function() {
// down();
// }, false)
// navBox.addEventListener("mousemove", function() {
// move();
// }, false);
// navBox.addEventListener("touchmove", function() {
// move();
// }, false)
// document.body.addEventListener("mouseup", function() {
// end();
// }, false);
// navBox.addEventListener("touchend", function() {
// end();
// }, false);
$(function() {
$(".icon-dot").click(function() {
if($(this).parent().hasClass("open")) {
get_event_log('1','关闭浮动指示');
$(this).parent().removeClass("open");
} else {
get_event_log('1','开启浮动指示');
$(".mj-float-nav").addClass("open");
// var r=parseInt($(".mj-float-nav").css("right"));
// var l=parseInt($(".mj-float-nav").css("left"));
// var lw=window.screen.width-208;
// if(r==15){
// $(".mj-float-nav").css("left",lw+"px");
// }
// if(l<window.screen.width/2){
// $(".mj-float-nav").css("left",0);
// }
}
});
});
</script>