-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
32 lines (30 loc) · 1.02 KB
/
main.js
File metadata and controls
32 lines (30 loc) · 1.02 KB
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
function showPic() {
// var pics = ['img/one.jpg',
// 'img/two.jpg',
// 'img/three.jpg',
// 'img/four.jpg',
// 'img/five.jpg',
// 'img/six.jpg',
// 'img/seven.jpg',
// 'img/eight.jpg',
// 'img/nine.jpg',
// 'img/ten.jpg'];
var pics = ['http://imgur.com/1bZXR52',
'http://imgur.com/hDEBuhd',
'http://imgur.com/kHIemCM',
'http://imgur.com/7oXxcyJ',
'http://imgur.com/TUA4xtU',
'http://imgur.com/7IraMf0',
'http://imgur.com/5TMiwdo',
'http://imgur.com/j37VzyS',
'http://imgur.com/kUBfpiV',
'http://imgur.com/cvEvRaC'];
var rand = Math.floor(Math.random() * pics.length);
var displayPic = '<img src="' + pics[rand] + '.jpg">';
$('#picContainer').html(displayPic);
}
var button = document.getElementById('another');
button.addEventListener('click', function() {
console.log('clicky');
showPic();
});