想做个手机网页的左边侧边栏,代码:<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> <script src="jq.js"></script></head><style type="text/css">*{padding: 0;margin:0;}body,html{width: 100%;height: 100%;}.wrap{width: 100%;height: 100%;position:fixed;top: 0;bottom: 0;left: 0;right: 0;background: #000}.wlef{width: 70%;z-index: 1;height: 100%;background: #ff0000}.wright{width: 100%;height: 100%;background: #fff;z-index: 9999;position: absolute;top: 0;left: 0%;}</style><body><div class="wrap"> <div class="wlef">234234234342</div> <div class="wright"><a href="javascript:void(0)">关闭左边菜单</a></div> <script type="text/javascript"> $(".wright a").click(function(){ var left = $(".wright").css('left') alert($(".wright").css('left')) if(!$(".wright").css('left') >= 0){ $(".wright").animate({left:'70%'},500); }else{ $(".wright").animate({left:'0'},500); } }); </script></div></body></html>不知道为什么判断wright的left值大于0的时候就是不会动,问题求解
添加回答
举报
0/150
提交
取消