Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Trying to fall asleep
Did I set my alarm?
Plan on working out, starting tomorrow.
Calculate hours of sleep I'd have if I feel asleep right now.
Worry about the future.
Think about that dumb thing I did 5 years ago.
Second guess todays decisions
css
/** * Switch Styles by Alexandre Joffroy */ @import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro"); body{ background-color: aliceblue; } .switch { height: 50px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; } .switch .slider { position: relative; display: inline-block; height: 8px; width: 32px; border-radius: 8px; cursor: pointer; background: #c5c5c5; -webkit-transition: all 0.2s ease; transition: all 0.2s ease; } .switch .slider:after { background: #eeeeee; position: absolute; left: -8px; top: -8px; display: block; width: 24px; height: 24px; border-radius: 50%; box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2); content: ''; -webkit-transition: all 0.2s ease; transition: all 0.2s ease; } .switch label { width: 200px; margin-left: 25px; } .switch .input { display: none; } .switch .input:checked ~ .slider:after { left: 16px; } .switch .input:checked ~ .slider { background: #fc5d9b; } .switch .input:checked ~ .slider:after { background: #ef0460; } body { height: 100vh; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center; } .center { font-family: 'Source Sans Pro', sans-serif; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; width: 300px; } h1 { text-align: center; font-weight: normal; font-size: 35px; margin-top: 0px; }
JavaScript
var checkboxes = document.querySelectorAll('input'); for( var i = 0; i < checkboxes.length; i++ ) { checkboxes[i].addEventListener("change", function() { updateBugs(this); }); } function updateBugs(changedElement) { var checkedCount = document.querySelectorAll('input:checked').length; // No bugs, thats impossible! if( checkedCount === 0 ) { turnOnRandomBug(changedElement); if( Math.random() >= 0.85 ) { turnOnRandomBug(changedElement); } } } function turnOnRandomBug(excluding) { turnOn = Math.floor(Math.random() * checkboxes.length); if( checkboxes[turnOn] === excluding) { turnOn = turnOn + 1; if( turnOn > (checkboxes.length - 1)) { turnOn = 0; } } checkboxes[turnOn].checked = true; } setTimeout(function() { turnOnRandomBug(null); }, 400)
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>js多选开关-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号