Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
First page
Second page
Third page
Fourth page
css
*, *:before, *:after { box-sizing: border-box; margin: 0; padding: 0; } .inner, .nav-panel ul .nav-btn:after { content: ""; position: absolute; top: 50%; left: 50%; } html, body { width: 100%; height: 100%; overflow: hidden; } @media (max-width: 767px) { body { font-size: 70%; } } .wrapper { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transition: transform 1.5s; perspective: 3000; transform-style: preserve-3d; } .wrapper .page { position: relative; width: 100%; height: 100%; transform: rotateX(180deg) scale(0.3); -webkit-backface-visibility: hidden; backface-visibility: hidden; transition: transform 1s ease-in-out; will-change: transform; } .wrapper .page h2 { color: #fff; position: absolute; top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%); text-transform: uppercase; font-size: 3em; } .wrapper .page.page1 { background-color: #66a6b8; background-image: linear-gradient(10deg,#66a6b8 20%, #5471B9 80%); } .wrapper .page.page2 { background-color: #f29c54; background-image: linear-gradient(45deg,#f29c54 0%, #DB4367 100%); } .wrapper .page.page3 { background-color: #23af56; background-image: linear-gradient(135deg,#23af56 0%, #67A79A 100%); } .wrapper .page.page4 { background-color: #412F2F; background-image: linear-gradient(160deg,#412F2F 15%, #6B2686 85%); } .wrapper.active-page1 { transform: translateY(0%); } .wrapper.active-page1 .page.page1 { transform: scale(1); } .wrapper.active-page2 { transform: translateY(-100%); } .wrapper.active-page2 .page.page2 { transform: scale(1); } .wrapper.active-page3 { transform: translateY(-200%); } .wrapper.active-page3 .page.page3 { transform: scale(1); } .wrapper.active-page4 { transform: translateY(-300%); } .wrapper.active-page4 .page.page4 { transform: scale(1); } .wrapper.active-page5 { transform: translateY(-400%); } .wrapper.active-page5 .page.page5 { transform: scale(1); } .wrapper.active-page6 { transform: translateY(-500%); } .wrapper.active-page6 .page.page6 { transform: scale(1); } .wrapper.active-page7 { transform: translateY(-600%); } .wrapper.active-page7 .page.page7 { transform: scale(1); } .wrapper.active-page8 { transform: translateY(-700%); } .wrapper.active-page8 .page.page8 { transform: scale(1); } .wrapper.active-page9 { transform: translateY(-800%); } .wrapper.active-page9 .page.page9 { transform: scale(1); } .wrapper.active-page10 { transform: translateY(-900%); } .wrapper.active-page10 .page.page10 { transform: scale(1); } .nav-panel { position: fixed; top: 50%; right: 2%; transform: translateY(-50%); z-index: 1000; transition: opacity 0.5s, transform 0.5s cubic-bezier(0.57, 1.2, 0.68, 2.6); will-change: transform, opacity; } .nav-panel.invisible { opacity: 0; transform: translateY(-50%) scale(0.5); } .nav-panel ul { list-style-type: none; } .nav-panel ul .nav-btn { position: relative; overflow: hidden; width: 1em; height: 1em; margin-bottom: 0.5em; border: 0.12em solid #fff; border-radius: 50%; cursor: pointer; transition: border-color, transform 0.3s; will-change: border-color, transform; } .nav-panel ul .nav-btn:after { width: 100%; height: 100%; border-radius: 50%; transform: translateX(-50%) translateY(-50%) scale(0.3); background-color: #fff; opacity: 0; transition: transform, opacity 0.3s; will-change: transform, opacity; } .nav-panel ul .nav-btn.active:after, .nav-panel ul .nav-btn:hover:after { transform: translateX(-50%) translateY(-50%) scale(0.7); opacity: 1; } .nav-panel ul .nav-btn:hover { border-color: yellow; transform: scale(1.2); } .nav-panel ul .nav-btn:hover:after { background-color: yellow; } .nav-panel .scroll-btn { position: absolute; left: 0; width: 1em; height: 1em; border: 0.2em solid #fff; border-left: none; border-bottom: none; cursor: pointer; transform-origin: 50% 50%; transition: border-color 0.3s; } .nav-panel .scroll-btn.up { top: -1.6em; transform: rotate(-45deg); } .nav-panel .scroll-btn.down { bottom: -1.2em; transform: rotate(135deg); } .nav-panel .scroll-btn:hover { border-color: yellow; } .check-out { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); font-size: 2rem; color: #fff; } .check-out a { color: #ffaaaa; text-decoration: none; padding-bottom: 0.3rem; border-bottom: 0.2rem solid; }
JavaScript
'use strict'; $(document).ready(function() { var $wrap = $(".wrapper"), pages = $(".page").length, scrolling = false, currentPage = 1, $navPanel = $(".nav-panel"), $scrollBtn = $(".scroll-btn"), $navBtn = $(".nav-btn"); /***************************** ***** NAVIGATE FUNCTIONS ***** *****************************/ function manageClasses() { $wrap.removeClass(function (index, css) { return (css.match (/(^|\s)active-page\S+/g) || []).join(' '); }); $wrap.addClass("active-page" + currentPage); $navBtn.removeClass("active"); $(".nav-btn.nav-page" + currentPage).addClass("active"); $navPanel.addClass("invisible"); scrolling = true; setTimeout(function() { $navPanel.removeClass("invisible"); scrolling = false; }, 1000); } function navigateUp() { if (currentPage > 1) { currentPage--; if (Modernizr.csstransforms) { manageClasses(); } else { $wrap.animate({"top": "-" + ( (currentPage - 1) * 100) + "%"}, 1000); } } } function navigateDown() { if (currentPage < pages) { currentPage++; if (Modernizr.csstransforms) { manageClasses(); } else { $wrap.animate({"top": "-" + ( (currentPage - 1) * 100) + "%"}, 1000); } } } /********************* ***** MOUSEWHEEL ***** *********************/ $(document).on("mousewheel DOMMouseScroll", function(e) { if (!scrolling) { if (e.originalEvent.wheelDelta > 0 || e.originalEvent.detail < 0) { navigateUp(); } else { navigateDown(); } } }); /************************** ***** RIGHT NAVIGATION **** **************************/ /* NAV UP/DOWN BTN PAGE NAVIGATION */ $(document).on("click", ".scroll-btn", function() { if ($(this).hasClass("up")) { navigateUp(); } else { navigateDown(); } }); /* NAV CIRCLE DIRECT PAGE BTN */ $(document).on("click", ".nav-btn:not(.active)", function() { if (!scrolling) { var target = $(this).attr("data-target"); if (Modernizr.csstransforms) { $wrap.removeClass(function (index, css) { return (css.match (/(^|\s)active-page\S+/g) || []).join(' '); }); $wrap.addClass("active-page" + target); $navBtn.removeClass("active"); $(this).addClass("active"); $navPanel.addClass("invisible"); currentPage = target; scrolling = true; setTimeout(function() { $navPanel.removeClass("invisible"); scrolling = false; }, 1000); } else { $wrap.animate({"top": "-" + ( (target - 1) * 100) + "%"}, 1000); } } }); });
粒子
时间
文字
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号