右下角跟随滚动条移动的图片 我想实现 当拉动滚动条的时候图片始终在右下角显示。。是相对屏幕静止的。并点击图片的时候返回页面的顶部。求完整代码~~~ 谢谢~~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style>*{ margin:0; padding:0;}.mock{ height:900px; width:900px; margin:0 auto; background:#333; color:red;}.fixedImg{ width:160px; height:240px; position:fixed; bottom:0; right:0; z-index:10px;}</style></head><body><div class="mock">啊啊啊啊啊啊啊</div><img src="http://farm7.static.flickr.com/6185/6075453511_63636c1b05_m.jpg" class="fixedImg" id="fixedImg" /><script type="text/javascript"> function $(el){return document.getElementById(el)}; var o = $("fixedImg"); o.onclick = function(){ document.body.scrollTop = 0; };</script></body></html>仅支持chrome,要用的话再写兼容的版本吧。1.IE6不支持fixed,用JS模拟吧。2.FF和IE获取scrollTop应该是document.documentElement.scrollTop,记不太清了 其实position:fixed;就挺好的 了。。 jquery 中如何用css设置background-image 求一个算法 请问如何定位div? 求js正则验证0~1之间数字的方法。可以为小数,0和1。 一个错误看了老半天不知道错误在哪,请指教了 如何根据下拉框选择的内容来和当前年份比较,自动获得一个值赋给一个隐藏表单? 100 分 求解一个关于回车的问题 求一段跑马灯的代码!,大侠们来帮忙 jquery怎么退出执行操作 HTML里的按钮如何变灰啊,快来看看啊 求讲解,如何实现在弹出的层里面切换页面?ajax吗? 怎样把这jquery的语句翻译成js的?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
*{
margin:0;
padding:0;
}
.mock{
height:900px;
width:900px;
margin:0 auto;
background:#333;
color:red;
}
.fixedImg{
width:160px;
height:240px;
position:fixed;
bottom:0;
right:0;
z-index:10px;
}
</style>
</head>
<body>
<div class="mock">
啊啊啊啊啊啊啊
</div>
<img src="http://farm7.static.flickr.com/6185/6075453511_63636c1b05_m.jpg" class="fixedImg" id="fixedImg" />
<script type="text/javascript">
function $(el){return document.getElementById(el)};
var o = $("fixedImg");
o.onclick = function(){
document.body.scrollTop = 0;
};
</script>
</body>
</html>
仅支持chrome,要用的话再写兼容的版本吧。
1.IE6不支持fixed,用JS模拟吧。
2.FF和IE获取scrollTop应该是document.documentElement.scrollTop,记不太清了