How do I make descriptive text disappear when audio is done playing? | XM Community
Question

How do I make descriptive text disappear when audio is done playing?

  • 30 March 2020
  • 2 replies
  • 5 views

Badge +1
I have descriptive text saying "Please press play.", and an audio file under it. I already have it so that the audio player disappears after it is done playing, using
jQuery('audio').on('ended', function() { jQuery(this).hide(); });
but I would like it so that the text disappears at the same time as the audio player.

2 replies

Userlevel 7
Badge +22
Use the below code:

var that = this;
jQuery('audio').on('ended', function() {
jQuery(this).hide();
jQuery("#"+that.questionId+" .QuestionText").hide();
});
Badge +1


Leave a Reply