-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex2.html
106 lines (103 loc) · 3.6 KB
/
index2.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>solar system</title>
</head>
<style type="text/css">
body{
font-family: "Arial";
color:#333;
background-color: #ccc;
margin: 16px 10%;
}
h1{
color:#333;
background-color: transparent;
}
a{
color: #c60;
background-color: transparent;
font-weight: bold;
text-decoration: none;
}
ul{
padding:0;
}
li{
float: left;
padding:1em;
list-style: none;
}
img{
display: block;
clear: both;
}
</style>
<!-- beta -->
<body>
<h1>Solar System</h1>
<ul id="imagegallery">
<li><a title="This is Sun"href="static/Sun太阳.jpg">Sun</a></li><!-- the Sun -->
<li><a title="This is Mecurcy"href="static/Mecurcy水星.jpg" onclick="showPic(this); return false;">Mecurcy</a></li><!-- the Mecurcy-->
<li><a title="This is Venus"href="static/Venus金星.jpg" onclick="showPic(this); return false;">Venus</a></li><!-- the Venus-->
<li><a title="This is Earth"href="static/Earth地球.jpg" onclick="showPic(this); return false;">Earth</a></li><!-- the Earth-->
<li><a title="This is Mars"href="static/Mars火星.jpg" onclick="showPic(this);return false;">Mars</a></li><!-- the Mars-->
<li><a title="This is Saturn"href="static/Saturn土星.jpg" onclick="showPic(this); return false;">Saturn</a></li><!-- the Saturn-->
<li><a title="This is Uranus"href="static/Uranus天王.jpg" onclick="showPic(this); return false;">Uranus</a></li><!-- the Uranus-->
<li><a title="This is Neptune"href="static/Neptune海王星.jpg" onclick="showPic(this); return false;">Neptune</a></li><!-- the Neptune-->
<li><a title="This is Pluto"href="static/Pluto冥王星.jpg" onclick="showPic(this); return false;">Pluto</a></li><!-- the Pluto-->
</ul>
<img id="placeholder" src="./static/0.jpg">
<p id="description">This is sun system.</p>
<!-- 平稳退化 -->
<a href="http://www.4399.com" onclick="popUp(this.href);return false;">平稳退化,防止禁用persudo-protocol</a><br>
<a href="http://www.4399.com">一般性做法</a>
<script>
/*完成*/
function showPic(whichpic){
var source = whichpic.getAttribute('href');
if(!document.getElementById('placeholder')) return true;
var placeholder = document.getElementById('placeholder');
if(placeholder.nodeName != 'IMG') return false;
placeholder.setAttribute('src',source);
if(document.getElementById("description")){
var text = whichpic.getAttribute('title') ? whichpic.getAttribute('title') : "";
var description = document.getElementById('description');
if(description.firstChild.nodeType == 3){
description.firstChild.nodeValue = text;
}
}
return true;
}
/*?*/
function prepareGallery(){
if(!document.getElementsByTagName) return false;
if(!document.getElementById) return false;
if(!document.getElementById('imagegallery')) return false;
var gallery = document.getElementById('imagegallery');
var links = gallery.getElementsByTagName("a");
for(var i = 0; i<links.length; i++){
links[i].onclick = function(){
return showPic(this) ? false : true;
}
}
}
function popUp(winURL){
window.open(winURL,"popUp","width=1000,height=480");
}
function addLoadEvent(func){
var oldEvent = window.onload;
if(typeof(oldEvent) != 'function'){
window.onload = func();
}else{
window.onload = function(){
oldEvent();
func();
}
}
}
addLoadEvent(prepareGallery);
</script>
</body>
</html>