mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-18 10:41:20 -08:00
使用 e.pageX
This commit is contained in:
1 parent
581b453ed2
commit
896de568cc
4 files changed
+5
-5
No files matched your search
@@ -2258,7 +2258,7 @@
|
||||
var _$progress$getBoundin = $progress.getBoundingClientRect(),
|
||||
left = _$progress$getBoundin.left;
|
||||
|
||||
var width = clamp(event.x - left, 0, $progress.clientWidth);
|
||||
var width = clamp(event.pageX - left, 0, $progress.clientWidth);
|
||||
var second = width / $progress.clientWidth * player.duration;
|
||||
var time = secondToTime(second);
|
||||
var percentage = clamp(width / $progress.clientWidth, 0, 1);
|
||||
@@ -2463,7 +2463,7 @@
|
||||
var _$volumeHandle$getBou = $volumeHandle.getBoundingClientRect(),
|
||||
handleWidth = _$volumeHandle$getBou.width;
|
||||
|
||||
var percentage = clamp(event.x - panelLeft - handleWidth / 2, 0, panelWidth - handleWidth / 2) / (panelWidth - handleWidth);
|
||||
var percentage = clamp(event.pageX - panelLeft - handleWidth / 2, 0, panelWidth - handleWidth / 2) / (panelWidth - handleWidth);
|
||||
return percentage;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user