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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<head> <title></title>
<style type= "text/css" >
#imgFrame{ position:absolute; top:40%; left:40%; z-index:1000; display:none;}
</style>
</head> <body> <div>
<ul>
<li>
<img src= "小图路径1"
original= "原图路径1"
onclick= "showOriginal(this)"
/>
</li>
<li>
<img src= "小图路径2"
original= "原图路径2"
onclick= "showOriginal(this)"
/>
</li>
<li>
<img src= "小图路径3"
original= "原图路径3"
onclick= "showOriginal(this)"
/>
</li>
<li>
<img src= "小图路径4"
original= "原图路径4"
onclick= "showOriginal(this)"
/>
</li>
</ul>
</div>
<div id= "imgFrame" >
<div><a href= "javascript:close();" >关闭</a></div>
<div id= "imgbox" ></div>
</div>
<script type= "text/javascript" >
function showOriginal(img) {
document.getElementById( "imgFrame" ).style.display = "block" ;
document.getElementById( "imgbox" ).innerHTML = "<img src=‘"
+ img.getAttribute( "original" ) + "‘ />" ;
}
function close() {
document.getElementById( "imgFrame" ).style.display = "none" ;
}
</script>
</body> </html> |