JAYASWAROOP commited on
Commit
1c0a46b
·
1 Parent(s): 1d636c2

Update audio.js

Browse files
Files changed (1) hide show
  1. audio.js +7 -7
audio.js CHANGED
@@ -13,21 +13,21 @@ document.addEventListener('DOMContentLoaded', function () {
13
  const otherAudio = otherContainer.querySelector('audio');
14
  if (otherAudio !== audio && !otherAudio.paused) {
15
  otherAudio.pause();
16
- otherAudio.style.display = 'none'; // Hide other audio elements
17
  }
18
  });
19
 
20
- // Toggle the display of the audio element
21
- if (audio.style.display === 'block') {
22
- audio.pause();
23
- audio.style.display = 'none';
24
- } else {
25
- audio.style.display = 'block';
26
  audio.play();
 
 
27
  }
28
  });
29
  });
30
 
 
31
  searchBar.addEventListener('input', function() {
32
  const searchText = searchBar.value.toLowerCase();
33
 
 
13
  const otherAudio = otherContainer.querySelector('audio');
14
  if (otherAudio !== audio && !otherAudio.paused) {
15
  otherAudio.pause();
16
+ otherAudio.classList.add('d-none'); // Hide other audio elements
17
  }
18
  });
19
 
20
+ // Toggle the display class of the audio element
21
+ audio.classList.toggle('d-none');
22
+ if (audio.paused) {
 
 
 
23
  audio.play();
24
+ } else {
25
+ audio.pause();
26
  }
27
  });
28
  });
29
 
30
+
31
  searchBar.addEventListener('input', function() {
32
  const searchText = searchBar.value.toLowerCase();
33