<table class="popup" style="position: absolute; background-color: black; border-radius: 10px; top: 50%; left: 50%;">
<tr>
<td>
<div>
<textarea style="margin:10px; background-color:azure; height:150px;width:100px;" contenteditable="true"></textarea>
</div>
</td>
</tr>
</table>
   $(function () {
var $popup = $('.popup');
$popup.css({marginLeft: $popup.width() / 2 * -1 + 'px', marginTop: $popup.height() / 2 * -1 + 'px' });
});

使用table的目的是,模拟弹窗的高度会根据弹窗的内容高度显示。

【原创】相对完美的垂直居中popup(modal/dialog),无需监听window.resize事件的更多相关文章

  1. 安卓奇葩问题之:返回按键监听,使Dialog不消失

    本文出处:http://bbs.9ria.com/thread-204406-1-1.html 在做自动更新的时候,弹出Dialog提示,要求是只能点击更新或者取消更新时Dialog才会消失.但是在这 ...

  2. SharePoint 2010 Modal Dialog

    SharePoint 2010 Modal Dialog Tweet   Modal dialog play very important role to improve the user exper ...

  3. Create Custom Modal Dialog Windows For User Input In Oracle Forms

    An example is given below to how to create a modal dialog window in Oracle Forms for asking user inp ...

  4. iframe中的jquery ui modal dialog 覆盖父窗口

    在iframe中 使用jquery ui dialog,弹出后可以覆盖父窗体 ///iframe中的jquery ui modal dialog 覆盖父窗口 function openDialog() ...

  5. wxPython Modal Dialog 模式对话框

    <wxPython in Action>chap 9 笔记 1. Modal Dialog(模式对话框) A modal dialog blocks other widgets from ...

  6. Create Dynamic Modal Dialog Form in AdminLTE Bootstrap template

    原文地址 Create modal dialog form in jquery using bootstrap framework, slightly different from the usual ...

  7. Issue 5158: Modal dialog present (UnexpectedAlertOpen) issue in IE (Similar issue like 3360)

    https://code.google.com/p/selenium/issues/detail?id=5158   Reported by mailtopa...@gmail.com, Feb 13 ...

  8. jQuery BlockUI Plugin Demo 5(Simple Modal Dialog Example)

    Simple Modal Dialog Example This page demonstrates how to display a simple modal dialog. The button ...

  9. VUE实现Studio管理后台(完结):标签式输入、名值对输入、对话框(modal dialog)

    一周的时间,几乎每天都要工作十几个小时,敲代码+写作文,界面原型算是完成了,下一步是写内核的HTML处理引擎,纯JS实现.本次实战展示告一段落,等RXEditor下一个版本完成,再继续分享吧.剩下的功 ...

随机推荐

  1. python的基础知识

    Python文件命名时不要有中文,不然在dos中不能执行 D:\Program Files\Py>Python hellyy.pyYear:2016Month(1-12):1Day(1-31): ...

  2. TextInputLayout setError() setErrorEnable()

    public void afterTextChanged(Editable s) { if (textInputLayout.getEditText().getText().toString().le ...

  3. iPhone被盗后续更新二:被换机!已取机!没扣住新机!怎么找新机呢?事发半年后跟进...

    先说下情况 MEID/IMEI:3544 2706 9380 456 我的序列号:F17NL088G5MY 新的IMEI:3569 7606 5956 097 新的序列号:DNPNV69ZG5MY 我 ...

  4. 实时事件统计项目:优化solr和morphline的时间字段

    morphline优化,如下: 传过来的时间戳被复制到3个字段:eventTimeInMinuteChina_tdt ,eventTimeInMinuteUTC_tdt ,eventTimeInHou ...

  5. 深入解析SQL Server并行执行原理及实践(上)

    在成熟领先的企业级数据库系统中,并行查询可以说是一大利器,在某些场景下他可以显著的提升查询的相应时间,提升用户体验.如SQL Server, Oracle等, Mysql目前还未实现,而Postgre ...

  6. python基础(七)函数

    作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! 函数最重要的目的是方便我们重复使用相同的一段程序. 将一些操作隶属于一个函数,以后 ...

  7. swift判断是否真机or模拟器

    之前一直用的这种,不知道为什么不怎么靠谱 #if TARGET_IPHONE_SIMULATOR//模拟器 #else//真机 #endif 现在用这种: if Platform.isSimulato ...

  8. ARM汇编与C混合编程

    GNU内联汇编 内联汇编即在C中直接使用汇编语句进行编程,使程序可以在C程序中实现C语言不能完成的一些工作,例如,在下面几种情况中必须使用内联汇编或嵌入型汇编 程序中使用饱和算术运算(Saturati ...

  9. ANDROID STDUIO 项目里的R文件突然丢失的解决办法N种之一

    刚刚项目里的R文件突然挂了,清理项目,关闭重开Studio,都不能解决.快没折了. 然后只好在项目上右击,看看有没有解决的办法.发现有个 Make Module ,姑且试试吧. 结果,竟然修复了.这是 ...

  10. Oracle数据库穿越防火墙访问

    原因 Oracle listener 只起一个中介作用,当客户连接它时,它根据配置寻找到相应的数据库实例进程,然后spawned一个新的数据库连接,这个连接端口由listener传递给客户机,此后客户 ...