mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 10:56:15 -08:00
Update thumbnails.js
This commit is contained in:
1 parent
00f780a7dc
commit
8f8b69cc25
1 file changed
+4
-1
@@ -14,6 +14,7 @@ export default function thumbnails(options) {
|
||||
let image = null;
|
||||
let loading = false;
|
||||
let isLoad = false;
|
||||
let isHover = false;
|
||||
|
||||
function showThumbnails(event) {
|
||||
const { width: posWidth } = getPosFromEvent(art, event);
|
||||
@@ -38,6 +39,7 @@ export default function thumbnails(options) {
|
||||
}
|
||||
|
||||
proxy($progress, 'mousemove', async (event) => {
|
||||
isHover = true;
|
||||
if (!loading) {
|
||||
loading = true;
|
||||
const img = await loadImg(option.thumbnails.url);
|
||||
@@ -45,13 +47,14 @@ export default function thumbnails(options) {
|
||||
isLoad = true;
|
||||
}
|
||||
|
||||
if (isLoad) {
|
||||
if (isLoad && isHover) {
|
||||
setStyle($control, 'display', 'flex');
|
||||
showThumbnails(event);
|
||||
}
|
||||
});
|
||||
|
||||
proxy($progress, 'mouseleave', () => {
|
||||
isHover = false;
|
||||
setStyle($control, 'display', 'none');
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user