求个效果,有演示。 本帖最后由 todown 于 2011-06-08 11:37:15 编辑 解决方案 » 免费领取超大流量手机卡,每月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> <title>zell419</title> <style type="text/css"> #right{position:fixed;_position:absolute;top:0px;_top:0px;right:100px;_right:100px; _margin-top:expression(this.style.pixelHeight+document.documentElement.scrollTop)} </style> </head> <body style="height:5000px;"> <div id="right"># right </div> </body> </html>这样 ?自己去通过left top left bottom 调整具体为主 。 不是这样的,你这个是默认浮动的,我要的是DIV开始固定在一个位置,当下拉条下拉的高度超过这个DIV 1px的时候,这个DIV变浮动。要用JS来写的,监控IE下拉条触发事件。大体原理我知道,但不知道怎么写。 <!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> <title></title> <script src="../demo/jquery-1.3.2.min.js" type="text/javascript"></script></head><body style="height:2800px;">*DIV开始固定在一个位置,当下拉条下拉的高度超过这个DIV 1px的时候,这个DIV变浮动*<div id="top" style="position:fixed; top:50px; left:50px;"> </div><div id="pan" style="width:160px; height:300px; border:dashed 1px black; position:absolute; right:0px; top:300px;"> </div><script type="text/javascript"> $(document).ready(function () { window.onscroll = function () { var t = document.documentElement.scrollTop; document.getElementById("top").innerHTML = t; if (t > 301) { $("#pan").css({ "position": "fixed", "top": "0" }); } else { $("#pan").css({ "position": "absolute", "top": "300" }); } } });</script></body></html> 各位我遇到一个问题,就是给ul li中的内容限制字数,但是火狐不兼容? 搞定 JavaScript _________贴子下沉的太快了,还没有解决,被删了 正则真不好理解,不好学,求教! 如何在自己的网站上使用google gear?? 如何确定一个值是否存在于下拉列表框中 jquery怎么排除页面中的选择器 求自考电子商务专业《网页设计与制作》电子书和相关资料 在DEEPTREE菜单中,我想让某一级默认是展开的怎么做? 求救!怎么在js离用到java的变量 文本框向列表框写入的问题,在线,等ING Ext.Msg.confirm让按钮聚焦到No上 求个正则表达式,先谢
<!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>
<title>zell419</title>
<style type="text/css">
#right{position:fixed;_position:absolute;top:0px;_top:0px;right:100px;_right:100px; _margin-top:expression(this.style.pixelHeight+document.documentElement.scrollTop)}
</style>
</head>
<body style="height:5000px;">
<div id="right"># right </div>
</body>
</html>这样 ?
自己去通过left top left bottom 调整具体为主 。
要用JS来写的,监控IE下拉条触发事件。大体原理我知道,但不知道怎么写。
<!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>
<title></title>
<script src="../demo/jquery-1.3.2.min.js" type="text/javascript"></script>
</head>
<body style="height:2800px;">
*DIV开始固定在一个位置,当下拉条下拉的高度超过这个DIV 1px的时候,这个DIV变浮动*
<div id="top" style="position:fixed; top:50px; left:50px;">
</div>
<div id="pan" style="width:160px; height:300px; border:dashed 1px black; position:absolute; right:0px; top:300px;">
</div>
<script type="text/javascript">
$(document).ready(function () {
window.onscroll = function () {
var t = document.documentElement.scrollTop;
document.getElementById("top").innerHTML = t; if (t > 301) {
$("#pan").css({ "position": "fixed", "top": "0" });
}
else {
$("#pan").css({ "position": "absolute", "top": "300" });
} }
});
</script>
</body>
</html>