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

lenahulllenahull West GroveCommunity Member Qubie ✭

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

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.

Answers

  • rondevrondev Community Member - Trial User Wizard ✭✭✭✭✭

    Use the below code:

    var that = this;
    jQuery('audio').on('ended', function() { 
      jQuery(this).hide(); 
      jQuery("#"+that.questionId+" .QuestionText").hide();
    });
    
  • lenahulllenahull West GroveCommunity Member Qubie ✭
    edited April 13
Sign In to Comment