<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
.outBox{
width: 200px;
height: 100px;
border-radius: 50px;
background: #CCCCCC;
position: relative;
}
.outBox .cirBox{
width: 100px;
height: 100px;
border-radius: 50px;
background: #41C47E;
position: absolute;
}
</style>
</head>
<body>
<div class="outBox">
<div class="cirBox"></div>
</div>
<script src="jquery-1.11.3.js"></script>
<script>
$('.outBox').on("click",function(){
var leftVal = parseInt($('.cirBox').css('left'));
//alert(leftVal);
if(leftVal == 0){
$('.cirBox').css('left','100px')
}else if(leftVal == 100){
$('.cirBox').css('left','0')
}
})
</script>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
PHP 开关效果demo
共2个文件
js:1个
html:1个
需积分: 13 11 下载量 182 浏览量
2017-05-26
14:37:52
上传
评论
收藏 80KB ZIP 举报
温馨提示
用来实现开关的效果,通过js来控制不同的处理事件。
资源推荐
资源详情
资源评论
收起资源包目录
test.zip (2个子文件)
test
index.html 812B
jquery-1.11.3.js 278KB
共 2 条
- 1
资源评论
357712792
- 粉丝: 0
- 资源: 16
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功