jQuery多层卡片堆叠展示导航菜单切换特效是一款点击汉堡包按钮,各个子菜单会以卡片的形式堆叠排列在窗口中,点击相应的子菜单就会切换到相应的页面上的动画导航菜单代码。
js代码
<script src="https://img.x22t.com/file/2020/04/25/aef4a62d765b8af142cf2c96f71fa60e4428.js?t=1"></script> <script src="https://img.x22t.com/file/2020/04/25/38a328155bd048d253a3e39a20a3b5a12770.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { var $demo = $(".demo"); var numOfSections = $(".demo__section").length; $(document).on("click", ".demo__menu-btn", function () { $demo.addClass("menu-active"); }); $(document).on("click", ".demo__close-menu", function () { $demo.removeClass("menu-active"); }); $(document).on("click", ".demo.menu-active .demo__section", function () { var $section = $(this); var index = +$section.data("section"); $(".demo__section.active").removeClass("active"); $(".demo__section.inactive").removeClass("inactive"); $section.addClass("active"); $demo.removeClass("menu-active"); for (var i = index + 1; i <= numOfSections; i++) { if (window.CP.shouldStopExecution(1)) { break; } $(".demo__section[data-section=" + i + "]").addClass("inactive"); } window.CP.exitedLoop(1); }); }); </script>
声明:本站资源均来源于互联网,如侵犯您的权益,请联系邮箱:afengim@88.com。谢谢,我们将在一天内进行处理。购买资源及会员后不支持退款,但我们将尽心尽力的为您解决问题,有任何问题联系QQ:3207346758;如您是游客模式下购买的资源,建议您立即注册账号(推荐使用QQ登录)以永久保留您的购买记录(可无限次下载)防止订单丢失造成损失。下载或购买资源即代表您已详细阅读并理解且同意 用户协议及下载须知