noisky / homepage Goto Github PK
View Code? Open in Web Editor NEW饭饭's Homepage 2.0
Home Page: http://noisky.cn
License: Apache License 2.0
饭饭's Homepage 2.0
Home Page: http://noisky.cn
License: Apache License 2.0
Line 154 in 8794106
原网址已不可用,应该为:
href="https://beian.miit.gov.cn/" rel="nofollow noopener noreferrer"
经测试,代码做如下优化,并去除一个点击空白处菜单出现复弹的情况
function bounceOutUp() {
$('.navigation-wrapper').on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
$('.navigation-wrapper').toggleClass('visible animated bounceOutUp');
$('.navigation-wrapper').off('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend');
});
$('.navigation-wrapper').toggleClass('animated bounceInDown animated bounceOutUp');
}
$('.btn-mobile-menu').click(function() {
if ($(".navigation-wrapper").hasClass("bounceInDown")) {
bounceOutUp();
} else {
$('.navigation-wrapper').toggleClass('visible animated bounceInDown');
}
$('.btn-mobile-menu__icon').toggleClass('fa fa-list fa fa-angle-up animated fadeIn');
});
// 点击下拉菜单以外的其他标签区域收起菜单生效
$(".panel-main").on('click', ':not(.mobile,.btn-mobile-menu,.navigation-wrapper)', function(e) {
if ($(".navigation-wrapper").hasClass("bounceInDown")) {
bounceOutUp();
$('.btn-mobile-menu__icon').toggleClass('fa fa-list fa fa-angle-up animated fadeIn');
}
});
// 阻止冒泡事件执行
$(".navigation-wrapper").click(function(event) {
event.stopPropagation();
});
<li class="navigation_item">
这玩意搞太多手机端下拉`` 底部 Copyright 这个会遮住 按不了。。
Line 30 in 372014d
$('.btn-mobile-menu').click(function() {
if ($('.navigation-wrapper').css('display') == "block") {
$('.navigation-wrapper').on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
$('.navigation-wrapper').toggleClass('visible animated bounceOutUp');
$('.navigation-wrapper').off('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend');
});
$('.navigation-wrapper').toggleClass('animated bounceInDown animated bounceOutUp');
} else {
$('.navigation-wrapper').toggleClass('visible animated bounceInDown');
}
$('.btn-mobile-menu__icon').toggleClass('fa fa-list fa fa-angle-up animated fadeIn');
});
// 判断是否为移动端
var isMobile = navigator.userAgent.toLowerCase().match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i) != null;
// 点击下拉菜单以外的其他标签区域收起菜单生效
$(document).on('click', ':not(.mobile,.navigation-wrapper,.btn-mobile-menu,.btn-mobile-menu__icon,panel-main__content)', function(e) {
if ($('.navigation-wrapper').css('display') == "block" && isMobile) {
$('.navigation-wrapper').on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
$('.navigation-wrapper').toggleClass('visible animated bounceOutUp');
$('.navigation-wrapper').off('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend');
});
$('.navigation-wrapper').toggleClass('animated bounceInDown animated bounceOutUp');
$('.btn-mobile-menu__icon').toggleClass('fa fa-list fa fa-angle-up animated fadeIn');
}
});
// 点击下拉菜单以外的空白区域收起菜单生效
$(".panel-cover").on('click', ':not(.navigation-wrapper)', function(e) {
if ($('.navigation-wrapper').css('display') == "block" && isMobile) {
$('.navigation-wrapper').on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
$('.navigation-wrapper').toggleClass('visible animated bounceOutUp');
$('.navigation-wrapper').off('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend');
});
$('.navigation-wrapper').toggleClass('animated bounceInDown animated bounceOutUp');
$('.btn-mobile-menu__icon').toggleClass('fa fa-list fa fa-angle-up animated fadeIn');
}
});
// 阻止冒泡事件执行
$(".navigation-wrapper").click(function(event) {
event.stopPropagation();
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.