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

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

  • March 30, 2020
  • 2 replies
  • 9 views

Forum|alt.badge.img+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

rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • March 30, 2020
Use the below code: var that = this; jQuery('audio').on('ended', function() { jQuery(this).hide(); jQuery("#"+that.questionId+" .QuestionText").hide(); });

Forum|alt.badge.img+1
  • Author
  • April 13, 2020