小白求教 大神请进 谢谢~~!!!!!

hehe19871123 2015-02-09 11:21:44

怎么能用jquery做出如图显示在右下角的浮动table 由于不是很会用jquery请贴出代码 跪谢大神
...全文
168 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
hehe19871123 2015-02-10
  • 打赏
  • 举报
回复
引用 7 楼 slwsss 的回复:
bottom: 100px;right: 100px;
引用 6 楼 hehe19871123 的回复:
搞定了 谢谢大神
slwsss 2015-02-10
  • 打赏
  • 举报
回复
bottom: 100px;right: 100px;
引用 6 楼 hehe19871123 的回复:
hehe19871123 2015-02-10
  • 打赏
  • 举报
回复
引用 5 楼 slwsss 的回复:
d.left = (sl + cw -v.width()-100) + "px"; d.top = (st + ch -v.height()-100) + "px"; 调下这两个的值
引用 4 楼 hehe19871123 的回复:
我试了 还是不可以 调试了下看 在这个判断的时候return了 我用的是IE浏览器 if(!(/MSIE [56]/g.test(navigator.appVersion) || (/MSIE [789]/g.test(navigator.appVersion) && (document.compatMode == "BackCompat"))))return
slwsss 2015-02-10
  • 打赏
  • 举报
回复
d.left = (sl + cw -v.width()-100) + "px"; d.top = (st + ch -v.height()-100) + "px"; 调下这两个的值
引用 4 楼 hehe19871123 的回复:
hehe19871123 2015-02-10
  • 打赏
  • 举报
回复
引用 3 楼 slwsss 的回复:
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script><div id="_a" style="position: fixed;bottom: 0px;right: 0px;background: #333;width: 100px;height: 100px;">
table放这里
</div>
<script>
  $(function(){
    if(!(/MSIE [56]/g.test(navigator.appVersion) || (/MSIE [789]/g.test(navigator.appVersion) && (document.compatMode == "BackCompat"))))return;
    var v=$('#_a').css({ "position":"absolute"});
    function f(){
      var d = {};
      var b= document.compatMode == "BackCompat";
      var cw=b?document.body.clientWidth:document.documentElement.clientWidth;
      var ch=b?document.body.clientHeight: document.documentElement.clientHeight;
      var sl=document.documentElement.scrollLeft || document.body.scrollLeft;
      var st=document.documentElement.scrollTop || document.body.scrollTop;
      d.left = (sl + cw -v.width()) + "px";
      d.top = (st + ch -v.height()) + "px";
      v.css(d)
    }
    $(window).resize(f).scroll(f);f();
  })
</script>
<div style="width:1px;height:3000px;background:red;">
谢谢大神 还有一个问题是 这个是显示在右下角了 但是它把滚动条覆盖了! 怎么办
slwsss 2015-02-09
  • 打赏
  • 举报
回复
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script><div id="_a" style="position: fixed;bottom: 0px;right: 0px;background: #333;width: 100px;height: 100px;">
table放这里
</div>
<script>
  $(function(){
    if(!(/MSIE [56]/g.test(navigator.appVersion) || (/MSIE [789]/g.test(navigator.appVersion) && (document.compatMode == "BackCompat"))))return;
    var v=$('#_a').css({ "position":"absolute"});
    function f(){
      var d = {};
      var b= document.compatMode == "BackCompat";
      var cw=b?document.body.clientWidth:document.documentElement.clientWidth;
      var ch=b?document.body.clientHeight: document.documentElement.clientHeight;
      var sl=document.documentElement.scrollLeft || document.body.scrollLeft;
      var st=document.documentElement.scrollTop || document.body.scrollTop;
      d.left = (sl + cw -v.width()) + "px";
      d.top = (st + ch -v.height()) + "px";
      v.css(d)
    }
    $(window).resize(f).scroll(f);f();
  })
</script>
<div style="width:1px;height:3000px;background:red;">
hehe19871123 2015-02-09
  • 打赏
  • 举报
回复
引用 1 楼 slwsss 的回复:
用绝对定位 <div style="position: fixed;bottom: 0px;right: 0px;background: #333;width: 100px;height: 100px;"> table放这里 </div>
但是有滚动条 不影响么
slwsss 2015-02-09
  • 打赏
  • 举报
回复
用绝对定位 <div style="position: fixed;bottom: 0px;right: 0px;background: #333;width: 100px;height: 100px;"> table放这里 </div>

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧