eagle

学无止境,细节决定成败.
posts - 12, comments - 11, trackbacks - 0, articles - 2
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

js页面窗口悬浮实现

Posted on 2009-07-01 21:23 月下孤城 阅读(9101) 评论(3)  编辑  收藏 所属分类: extjs

需求:在设计web页面时,有时会让某个窗口悬浮在页面某侧,并随浏览器滚动做相应浮动。

代码:
html代码
 <div id="chatDiv" style="position: absolute; buttom: 0px; right: 0px;  ">悬浮页面</div>

js代码
 /*会话面板悬浮*/
 window.onscroll = function () {
        var div = document.getElementById("chatDiv");
        div.style.top = document.body.scrollTop;
    };
    window.onresize = window.onscroll;
    window.onscroll();
   
说明:html代码中css设置id为chatDiv的div元素显示位置.js代码实现浏览器滚动条滚动与div显示位置。




---------------------
月下孤城
mail:eagle_daiqiang@sina.com

评论

# re: js页面窗口悬浮实现  回复  更多评论   

2013-05-17 20:59 by dasd
asdsad

# re: js页面窗口悬浮实现  回复  更多评论   

2014-12-11 16:18 by 速度
死骗子

# re: js页面窗口悬浮实现  回复  更多评论   

2015-04-13 14:26 by http://job.cnblogs.com/
http://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/http://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/http://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/http://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/http://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/http://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/http://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/http://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/http://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/http://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/http://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/http://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/http://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/http://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/http://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/http://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/vhttp://job.cnblogshttp://job.cnblogs.com/.http://job.cnblogs.com/com/http://job.cnblogs.com/v

只有注册用户登录后才能发表评论。


网站导航: