87,989
社区成员
发帖
与我相关
我的任务
分享
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title> 页面名称 </title>
<style type="text/css">
html,body {
height: 100%;
}
#imgbox {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: #000 no-repeat center center;
background-size: contain;
z-index: 99999;
display: none;
}
#imgbox.show {
display: block;
}
</style>
</head>
<body>
<img src="xxxx.jpg" width="192" height="120" border="0" alt="" onclick="fs(this.src)">
<div id="imgbox" onclick="fs(false)"></div>
<script type="text/javascript">
function fs(n) {
var obj = document.getElementById("imgbox");
if (n) {
obj.style.backgroundImage = "url("+n+")";
obj.className = "show";
} else {
obj.className = "";
}
}
</script>
</body>
</html>