navBall2.html 3.52 KB
<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('Yyservice/yy_order_list',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>