Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Select
Review
Payment
Success
Toggle Click Radius
css
body { background: #E8DFD9; } .squares { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); } .boxes { position: fixed; top: 50%; left: 50%; width: 90%; max-width: 790px; height: 180px; font-family: "Open Sans", sans-serif; transform: translate(-50%, -50%); } .box { position: relative; display: flex; align-items: center; flex-direction: row; background: #FFF; width: 100%; height: 100%; border-radius: 20px; box-shadow: 40px 0 65px rgba(212, 197, 186, 0.4); padding: 0 80px; box-sizing: border-box; opacity: 0; transform-origin: center; transform: scale(1.2, 1.2); } .box:nth-child(1), .box:nth-child(2) { position: absolute; } .box:nth-child(1) { left: 3%; width: 94%; } .box:nth-child(2) { left: 2%; width: 96%; } .progress { position: relative; display: flex; flex-direction: row; justify-content: space-between; width: 100%; } .bar { position: absolute; top: 50%; left: 50%; background: #E8DFD8; width: 100%; height: 3px; border-radius: 10px; transform: translate(-50%, -50%); overflow: hidden; } .bar__fill { display: block; background: #BD8044; height: 100%; } .point { position: relative; color: #AC9585; cursor: pointer; } .point:before { content: ""; position: absolute; top: 50%; left: 50%; width: 120px; height: 120px; border-radius: 100%; transform: translate(-50%, -50%); transition: 0.3s ease; } .show-radius .point:before { background: rgba(0, 0, 0, 0.1); } .point--complete, .point--active { color: #BA7C3F; } .bullet { z-index: 1; position: relative; background: #AC9585; width: 8px; height: 8px; border-radius: 100%; transition: 0.3s ease; } .point--complete .bullet, .point--active .bullet { background: #FFFFFF; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 6px #BD8044; } .point--active .bullet { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 10px #BD8044; } .label { position: absolute; top: 100%; left: 50%; margin: 20px 0 0 0; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; transform: translate(-50%, 0); } .radius-toggle { position: absolute; top: 20px; left: 20px; display: block; background: #FFF; border: 0; border-radius: 4px; box-shadow: 40px 0 65px rgba(212, 197, 186, 0.4); padding: 10px; color: #BA7C3F; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
JavaScript
var $boxOne = $('.box:nth-child(1)'), $boxTwo = $('.box:nth-child(2)'), $boxThree = $('.box:nth-child(3)'); var boxOne = new TimelineMax(), boxTwo = new TimelineMax(), boxThree = new TimelineMax(); boxOne.to($boxOne, 0.6, { opacity: 0.25, scale: 1, ease: Back.easeOut }).to($boxOne, 0.6, { rotation: 4, ease: Back.easeOut }, 2); boxTwo.to($boxTwo, 0.6, { opacity: 0.5, scale: 1, ease: Back.easeOut }, 0.6).to($boxTwo, 0.6, { rotation: -4, ease: Back.easeOut }, 1.8); boxThree.to($boxThree, 0.6, { opacity: 1, scale: 1, ease: Back.easeOut }, 1.2); /** * Point Animation */ $('.point').on('click', function(e) { var getTotalPoints = $('.point').length, getIndex = $(this).index(), getCompleteIndex = $('.point--active').index(); TweenMax.to($('.bar__fill'), 0.6, { width: (getIndex - 1) / (getTotalPoints - 1) * 100 + '%' }); if (getIndex => getCompleteIndex) { $('.point--active').addClass('point--complete').removeClass('point--active'); $(this).addClass('point--active'); $(this).prevAll().addClass('point--complete'); $(this).nextAll().removeClass('point--complete'); } }); /* Demo Purposes */ var progressAnimation = function() { var getTotalPoints = $('.point').length, getIndex = Math.floor(Math.random() * 4) + 1, getCompleteIndex = $('.point--active').index(); TweenMax.to($('.bar__fill'), 0.6, { width: (getIndex - 1) / (getTotalPoints - 1) * 100 + '%' }); if (getIndex => getCompleteIndex) { $('.point--active').addClass('point--complete').removeClass('point--active'); $('.point:nth-child(' + (getIndex + 1) + ')').addClass('point--active'); $('.point:nth-child(' + (getIndex + 1) + ')').prevAll().addClass('point--complete'); $('.point:nth-child(' + (getIndex + 1) + ')').nextAll().removeClass('point--complete'); } }; var animateProgress = setInterval(progressAnimation, 1200); $(document).hover(function() { clearInterval(animateProgress) }); $('.radius-toggle').on('click', function() { $('body').toggleClass('show-radius') });
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>交互式进度条-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号