Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Home
Photo gallery
About
Blog
Contact
css
body { font-family: "Titillium Web", sans-serif; background: #3050F0; color: white; letter-spacing: 0.2em; } .menu { margin: 40vh auto 0; padding: 0; list-style-type: none; width: 75%; max-width: 960px; min-width: 320px; font-size: calc(.75em + .75vw); position: relative; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-flex: 0; -ms-flex: 0 1 auto; flex: 0 1 auto; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; } .menu a { display: block; color: inherit; text-decoration: none; text-align: center; } .menu.has-magic-line .active a { border-bottom: none; } .menu .menu-item { width: auto !important; display: inline-block !important; margin-right: 1em; } .menu .menu-item a { padding-bottom: 0.25em; border-bottom: 0.125em solid transparent; } .menu .menu-item.active a, .menu .menu-item:hover a { border-bottom-color: white; } .magic-line { position: absolute; bottom: 0; left: 0; height: 0.125em; background-color: white; width: 1px !important; -webkit-transform: translateX(0); transform: translateX(0); -webkit-transform-origin: left; transform-origin: left; -webkit-transition: -webkit-transform 0.4s; transition: -webkit-transform 0.4s; transition: transform 0.4s; transition: transform 0.4s, -webkit-transform 0.4s; -webkit-backface-visibility: hidden; backface-visibility: hidden; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; will-change: transform; } .no-csstransitions .magic-line, .no-csstransforms .magic-line { display: none; }
JavaScript
(function () { var magicLine, bind = function (fn, me) { return function () { return fn.apply(me, arguments); }; }; magicLine = function () { function magicLine(menu) { this.menu = menu; this.update = bind(this.update, this); if (!this.menu.length) { return; } $('
', { 'class': 'magic-line' }).appendTo(this.menu.addClass('has-magic-line')); this.update(); $(window).resize(this.update); } magicLine.prototype.update = function () { var el, leftPos, ratio; el = this.menu.find('.active'); if (el.length) { leftPos = el.position().left; ratio = el.width(); } else { leftPos = ratio = 0; } return this.menu.find('.magic-line').css({ transform: 'translateX( ' + leftPos + 'px ) scaleX( ' + ratio + ' )' }); }; return magicLine; }(); window.magicLine = new magicLine($('.menu')); $('.menu-item').on('click', function (e) { e.preventDefault(); $(this).addClass('active').siblings().removeClass('active'); return window.magicLine.update(); }); }.call(this));
粒子
时间
文字
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号