-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjz.js
68 lines (68 loc) · 2.13 KB
/
jz.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// see-farm, animals, background, moevement
// do-click animals
// expect-hear sounds of different animals for the animals to move
// select animal on click
$('#pig').click(function() {
// randomize number for the variable
var randPosX = ((Math.random()*1100));
var randPosY = ((Math.random()*600));
//call for the first div audio
var audio = $("#pigglet")[0];
console.log(randPosY)
// randomize direction movement for element
$('#pig').css('left', randPosX);
$('#pig').css('top', randPosY);
audio.play();
});
// select animal on click
$('#goat').click(function() {
// randomize number for the variable
var randPosX = ((Math.random()*1100));
var randPosY = ((Math.random()*600));
//call for the first div audio
var audio = $("#kid")[0];
console.log(randPosY)
// randomize direction movement for element
$('#goat').css('left', randPosX);
$('#goat').css('top', randPosY);
audio.play();
});
// select animal on click
$('#horse').click(function() {
// randomize number for the variable
var randPosX = ((Math.random()*1100));
var randPosY = ((Math.random()*600));
//call for the first div audio
var audio = $("#babe")[0];
console.log(randPosY)
// randomize direction movement for element
$('#horse').css('left', randPosX);
$('#horse').css('top', randPosY);
audio.play();
});
// select animal on click
$('#cow').click(function() {
// randomize number for the variable
var randPosX = ((Math.random()*1100));
var randPosY = ((Math.random()*600));
//call for the first div audio
var audio = $("#moo")[0];
console.log(randPosY)
// randomize direction movement for element
$('#cow').css('left', randPosX);
$('#cow').css('top', randPosY);
audio.play();
});
// randomize direction of movement
$('#dog').click(function() {
// randomize number for the variable
var randPosX = ((Math.random()*1100));
var randPosY = ((Math.random()*600));
//call for the first div audio
var audio = $("#pup")[0];
// randomize direction movement for element
$('#dog').css('left', randPosX);
$('#dog').css('top', randPosY);
audio.play();
;
});