Y
Y
Yarik2020-08-27 11:33:50
css
Yarik, 2020-08-27 11:33:50

The current volume level as in VK?

Tell me the algorithm, how to make such a display of the percentage volume level of VK music from pointing the mouse to the slider?
5f476fb37f66c871289592.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2020-08-27
@Stalker_RED

More or less like this

Styles still need to be finished and add throttle / debounce probably.
You can also transition, and hide through opacity.

F
fallus, 2020-08-27
@fallus

If it is 1 audio player then:

spoiler
Если плееров много будет, то вместо querySelector юзать нужно querySelectorAll.
Потом циклом по ним проходиться, подписывая события на каждый.
И в этом случае, стоит обозначать, какой контейнер(с атрибутом data-hint) соответствует какому аудио-плееру.
Проще всего, как в этом примере. Чтобы этот контейнер был родителем аудио-плееру.
Чтобы в цикле, например, этот аудио-плеер можно было легко найти, например так:
var myAudio = myAudioHoverBlock[i].querySelector('audio')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question