mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 14:07:06 +08:00
1. 修復 點擊特效 烟花 無效的Bug
This commit is contained in:
@@ -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) {
|
||||
var timeout, context, args, result;
|
||||
var previous = 0;
|
||||
@@ -81,6 +97,7 @@ function snackbarShow(text, showAction, duration) {
|
||||
}
|
||||
|
||||
|
||||
window.debounce = debounce
|
||||
|
||||
window.throttle = throttle
|
||||
|
||||
|
||||
Reference in New Issue
Block a user