-
Notifications
You must be signed in to change notification settings - Fork 5
/
Tulips.html
40 lines (40 loc) · 1.25 KB
/
Tulips.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
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="js/Tulips.js"></script>
<style type="text/css">
#img {
width: 100%;
transition: width 2s;
-moz-transition: width 2s; /* Firefox 4 */
-webkit-transition: width 2s; /* Safari 和 Chrome */
-o-transition: width 2s; /* Opera */
}
#main {
position: absolute;
top: 7px;
}
</style>
<script>
window.onload = function () {
var imgEles = document.getElementsByTagName('img');
for(var i=0; i < imgEles.length;i++) {
var img = imgEles[i];
new Tulips().init({
imgElement:imgEles[i],
row:3,
column:3,
sucRemove: true,
success:function(imgElement){
document.body.style['background-image'] = 'url(' + imgElement.src + ')';
document.body.style['background-size'] = 'cover';
}
});
}
}
</script>
</head>
<body>
<a href="haha.html"><img id="img" src="image/asuka.jpeg"/></a>
</body>
</html>