mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-17 18:11:20 -08:00
添加自动隐藏光标
This commit is contained in:
1 parent
617fd9681e
commit
d9fd20bdf3
14 files changed
+127
-27
No files matched your search
@@ -115,3 +115,17 @@ export function sleep(ms = 0) {
|
||||
export function sublings(target) {
|
||||
return Array.from(target.parentElement.children).filter(item => item !== target);
|
||||
}
|
||||
|
||||
export function debounce(func, wait, scope) {
|
||||
let timeout;
|
||||
return function fn() {
|
||||
const context = scope || this;
|
||||
const args = arguments;
|
||||
const later = function later() {
|
||||
timeout = null;
|
||||
func.apply(context, args);
|
||||
};
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(later, wait);
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user