mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
1. 修復 點擊特效 烟花 無效的Bug
This commit is contained in:
parent
8cb366bdda
commit
da4a8d77d7
@ -152,7 +152,7 @@
|
|||||||
transform: translateX(-254px)
|
transform: translateX(-254px)
|
||||||
opacity: 1
|
opacity: 1
|
||||||
|
|
||||||
// pc界面打開mobile-menus需關閉sidebar
|
// pc界面打開mobile-menus需關閉sidebar
|
||||||
#sidebar
|
#sidebar
|
||||||
left: -300px !important
|
left: -300px !important
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,19 @@
|
|||||||
|
function debounce(func, wait, immediate) {
|
||||||
|
var timeout
|
||||||
|
return function () {
|
||||||
|
var context = this
|
||||||
|
var args = arguments
|
||||||
|
var later = function () {
|
||||||
|
timeout = null
|
||||||
|
if (!immediate) func.apply(context, args)
|
||||||
|
}
|
||||||
|
var callNow = immediate && !timeout
|
||||||
|
clearTimeout(timeout)
|
||||||
|
timeout = setTimeout(later, wait)
|
||||||
|
if (callNow) func.apply(context, args)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
function throttle(func, wait, options) {
|
function throttle(func, wait, options) {
|
||||||
var timeout, context, args, result;
|
var timeout, context, args, result;
|
||||||
var previous = 0;
|
var previous = 0;
|
||||||
@ -81,6 +97,7 @@ function snackbarShow(text, showAction, duration) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
window.debounce = debounce
|
||||||
|
|
||||||
window.throttle = throttle
|
window.throttle = throttle
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user