jquery开关按钮效果
2024-09-09 20:27:49
.circular1{
width: 50px;
height: 30px;
border-radius: 16px;
background-color: #ccc;
transition: .3s;
cursor: pointer;
}
.round-button1{
width: 30px;
height: 30px;
background: #fff;
border-radius: 50%;
box-shadow: 0 1px 5px rgba(0,0,0,.5);
transition: .3s;
position: relative;
left:;
}
.round-button1:hover{
transform: scale(1.2);
box-shadow: 0 1px 8px rgba(0,0,0,.5);
}
<div class="circular1">
<div class="round-button1"></div>
</div>
$(function () {
$('.circular1').click(function () {
var left = $('.round-button1').css('left');
left = parseInt(left);
if (left == 0) {
$('.round-button1').css({'left': '22px', 'background-color': '#F00'});
$(this).css({'background-color': '#e7e7e7', 'box-shadow': '0 0 5px #999 inset'})
} else {
$('.round-button1').css({'left': '0', 'background-color': '#fff'}) }
})
})
最新文章
- [LeetCode] Pacific Atlantic Water Flow 太平洋大西洋水流
- jQuery静态方法parseXML使用和源码分析
- openssh/ntp/ftp漏洞
- selenium结合sikuliX操作Flash网页
- JS模块规范 前端模块管理器
- 转】从源代码剖析Mahout推荐引擎
- PHP全局变量
- cf C. Divisible by Seven
- 记一次解决curl https证书问题
- 监控gc
- vb6.0的各种SHELL,CMD内部命令、外部命令、SHELL任意文件
- CCF-201412-2-Z字形扫描
- IT运维如何防止陷入“中年油腻”和频繁被动地打“遭遇战”?
- Linux 用户打开进程数的调整
- 二.django项目环境搭建
- Android -- 贝塞尔曲线公式的推导和简单使用
- DP常用模板
- (7)Why 30 is not the new 20
- rpm_快速安装saltstake
- poj2387 Til the Cows Come Home(Dijkstra)
热门文章
- Select、Poll与Epoll比较
- linux中syscall调用号查看
- 双系统或三系统:Grub Rescue修复方法
- DB Query Analyzer 5.02 is distributed, 53 articles concerned have been published
- wait和notify的理解与使用
- 【备忘】Windows的命令行下设置网络代理
- 基类包括字段“ScriptManager1”,但其类型(System.Web.UI.ScriptManager)与控件(System.Web.UI.ScriptManager)的类型不兼容
- python爬虫错误总结
- mysql-入门
- C#读取shp文件并获取图形保存到sde要素类中(不使用ESRI的类库,纯c#实现)