Home  >  Article  >  Web Front-end  >  Does html5 audio support fade-in and fade-out effects? _html/css_WEB-ITnose

Does html5 audio support fade-in and fade-out effects? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:55:171727browse

As per the title, I want to achieve the fade-in and fade-out effect. How to achieve it? Thank you!


Reply to discussion (solution)

Adjust transparency?
Fade in: $('audio').animate({opacity:0},5000)
Fade out: $('audio').animate({opacity:1},5000)

It's not the fade in and out of the picture, it's the fade in and out of the sound

Adjust the transparency?
Fade in: $('audio').animate({opacity:0},5000)
Fade out: $('audio').animate({opacity:1},5000)

You can use a timer to modify the volume regularly to create a fade-in and fade-out effect

You can use a timer to modify the volume regularly to create a fade-in and fade-out effect


Monitor playback Duration, and then set the conditions to play

Thank you everyone, you can set the timing to adjust and reduce the volume to achieve this.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn