宇筱博客

  • 解决办法
  • 学无止境
  • 记录时光
  • 百宝箱
宇筱博客
点滴记忆,汇聚成海。
  1. 首页
  2. 解决办法
  3. 正文

弹出div或者弹出新窗口的固定位置、固定大小

2018年1月1日 415点热度 0人点赞 0条评论

js代码:

//打开一个新窗口,固定的位置,固定的大小

       //window.open("push_add.html",'newwindow', 'height=550, width=1000, top=200, left=500, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no');

//弹出一个div

var $box = $('.box');

   $box.css({

        //设置弹出层距离左边的位置

        left: ($("body").width() - $box.width()) / 2 - 20 + "px",

        //设置弹出层距离上面的位置

        top: ($(window).height() - $box.height()) / 2 + $(window).scrollTop() + "px",

        display: "block"

    });

原文链接:https://my.oschina.net/wangyandong/blog/549444

标签: 暂无
最后更新:2018年1月1日

小渔民

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2025 宇筱博客. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

豫ICP备15017825号-2