-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgallery.js
28 lines (21 loc) · 1 KB
/
gallery.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
function upDate(previewPic) {
/* In this function you should
1) change the url for the background image of the div with the id = "image"
to the source file of the preview image
2) Change the text of the div with the id = "image"
to the alt text of the preview image
*/
old = document.getElementById("image").innerHTML
document.getElementById("image").innerHTML = previewPic.alt
document.getElementById("image").style.background = "url(" + previewPic.src + ")";
}
function unDo() {
/* In this function you should
1) Update the url for the background image of the div with the id = "image"
back to the orginal-image. You can use the css code to see what that original URL was
2) Change the text of the div with the id = "image"
back to the original text. You can use the html code to see what that original text was
*/
document.getElementById("image").innerHTML = old
document.getElementById("image").style.background = "#8e68ff";
}