-
Notifications
You must be signed in to change notification settings - Fork 0
/
b.js
57 lines (34 loc) · 928 Bytes
/
b.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*heart click*/
function myFunction(x) {
x.classList.toggle("fas"); //changine class
x.style="color:#bda4a7";
};
/*PLAY SONG ON ANY CLICK*/
$(document).ready(function(){
var obj = new Audio();
obj.src = "sound/click.mp3";
obj.volume = 0.10;
obj.autoPlay = false;
obj.preLoad = true;
$('.audio').click(function(){
obj.play();
});
});
var playBtn = document.getElementById('play');
var audio = document.getElementById('audio');
var stopbtn = document.getElementById('stop');
var playSound = function () {
audio.play();
};
var stopSound = function () {
audio.pause();
audio.currentTime = 0;
};
playBtn.addEventListener('click', playSound, false);
stopbtn.addEventListener('click', stopSound, false);
/*dark theme toggle jquery*/
/*on clicking toggler new class with left more gap added*/
/*heart click*/
function myFunction2(x1) {
x1.classList.toggle("pause"); //changine class
};