-
Notifications
You must be signed in to change notification settings - Fork 0
/
PhotoFade.html
79 lines (73 loc) · 2.24 KB
/
PhotoFade.html
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
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html>
<title>Javascript DOM</title>
<head>
<style>
body{
margin:0;
padding:0;
width:100%;
}
#wrapper {
width:100%;
margin:0;
padding:0;
float:left;
height:100%;
background-color: gray;
}
.images {
float:left;
width:50%;
opacity:.15;
transition:1s;
}
</style>
</head>
<body>
<div id="wrapper">
<img class="images" src="http://www.sbs.com.au/news/sites/sbs.com.au.news/files/images/2/6/26Dec_NBA_800x600.jpg" id="image1">
<img class="images" src="http://onmilwaukee.com/images/articles/bu/buckswarriors/buckswarriors_fullsize_story1.jpg?1449606693" id="image2">
<img class="images" src="http://www.sportstarlive.com/multimedia/dynamic/02765/WARRIORS_LAKERS_Cr_2765588b.jpg" id="image3">
<img class="images" src="http://www.hindustantimes.com/rf/image_size_800x600/HT/p1/2015/06/17/Incoming/Pictures/1359642_Wallpaper2.jpg" id="image4">
<img class="images" src="http://aviewfrommyseat.com/wallpaper/anonymous-20140527200947.jpg" id="image5">
<img class="images" src="http://img15.deviantart.net/c89e/i/2013/223/5/e/bo_knows_defense_by_taliaspadre-d6hlsl8.jpg" id="image6">
</div>
<script>
var pix = document.getElementsByClassName('images');
for (var i=0; i<pix.length; i++){
pix[i].onmouseover = appear;
function appear(){
this.style.opacity = "1";
}
pix[i].onmouseout = function(){
this.style.opacity = ".4"
}
};
/*document.getElementById('image1').onmouseover = appear;
function appear(){
this.style.opacity="1"
};
document.getElementById('image2').onmouseover = appear;
function appear(){
this.style.opacity="1"
};
document.getElementById('image3').onmouseover = appear;
function appear(){
this.style.opacity="1"
};
document.getElementById('image4').onmouseover = appear;
function appear(){
this.style.opacity="1"
};
document.getElementById('image5').onmouseover = appear;
function appear(){
this.style.opacity="1"
};
document.getElementById('image6').onmouseover = appear;
function appear(){
this.style.opacity="1"
};*/
</script>
</body>
</html>