61,115
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Document</title>
<style>
#pic {
position: absolute;
left: 0;
top: 0;
}
#content {
background-color: #999;
width: 9999px;
height: 9999px;
}
</style>
</head>
<body>
<img src="F:\My Pictures\26ad734b-324e-4472-8206-8a932a888f11.jpg" width="1113" height="4929" border="0" id="pic">
<div id="content"></div>
<script type="text/javascript">
window.onscroll = function () {
document.getElementById("pic").style.left = (document.body.scrollLeft || document.documentElement.scrollLeft)+"px";
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Document</title>
<style>
#pic {
position: fixed;
left: 0;
top: 0;
}
#content {
background-color: #999;
width: 9999px;
height: 9999px;
}
</style>
</head>
<body>
<img src="F:\My Pictures\26ad734b-324e-4472-8206-8a932a888f11.jpg" width="1113" height="4929" border="0" id="pic">
<div id="content"></div>
<script type="text/javascript">
window.onscroll = function () {
document.getElementById("pic").style.top = (-(document.body.scrollTop || document.documentElement.scrollTop))+"px";
}
</script>
</body>
</html>