在Jquery中让一个容器div显示在屏幕正中央

news/2024/7/11 1:50:52 标签: jquery, div
<div id="article_content" class="article_content clearfix"> <div id="content_views" class="htmledit_views"> 非常简单就实现了,代码不用解释,很容易懂的   
   
//request data for centering
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
var popupHeight = $("#popupContact").height();
var popupWidth = $("#popupContact").width();
//centering
$("#popupContact").css({
    "position": "absolute",
    "top": windowHeight/2-popupHeight/2,
    "left": windowWidth/2-popupWidth/2
}); div> div> <div id="treeSkill">div>

http://www.niftyadmin.cn/n/1412086.html

相关文章

使用spring-data-redis操作Redis集群

2019独角兽企业重金招聘Python工程师标准>>> 1. Maven依赖 注&#xff1a;spring-data-redis版本要大于1.7 <dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.12</version><scope>t…

day91 orm查询以及xss安全攻击

目录 ORM&#xff08;后续&#xff09;数据准备&#xff1a;数据操作orm查询大全安全攻击xss重学正则 静态执行命令 pycharm创的表&#xff0c;用native删了&#xff0c;pycharm就不会再创建了&#xff0c;除非再用native去建 ORM&#xff08;后续&#xff09; 数据准备&#x…

操作Web.config的AppSettings

操作Web.config的AppSettings /// <summary>/// 操作Xml的AppSettings/// </summary>/// <param name"webConfigPath"></param>/// <param name"AppsettingsAddKey"></param>/// <param name"KeyValue"&…

windows下如何设置定时任务

2019独角兽企业重金招聘Python工程师标准>>> 环境&#xff1a;win7 举例&#xff1a;我们需要定时的运行一段名为test.php脚本(代码验证过&#xff0c;可以正确执行)&#xff0c;脚本如下&#xff1a; <?php $fp fopen("test.txt", "a"); …

MSN消息提示类

纯js编写 跨框架 无图片 支持调速度 任意位置弹出 需要ie5.5以上 <HTML><HEAD><SCRIPT languageJavaScript><!--/**//* ** ** 类名&#xff1a;CLASS_MSN_MESSAGE ** 功能&#xff1a;提供类似MSN消息框 ** 示例&#xff1a; ----…

day90 路由系统以及orm

目录 路由系统创建app&#xff1a;极其重要app的目录结构&#xff1a;路由的分组&#xff1a;路由的分发两个特殊的页面路由反向路由解析&#xff1a;处理业务逻辑的方式Http的请求方法&#xff1a;ORM创建的模型&#xff08;model&#xff09;的步骤极其重要&#xff1a;一对多…

python3 爬虫之爬取糗事百科

闲着没事爬个糗事百科的笑话看看 python3中用urllib.request.urlopen()打开糗事百科链接会提示以下错误 http.client.RemoteDisconnected: Remote end closed connection without response 但是打开别的链接就正常&#xff0c;很奇怪不知道为什么&#xff0c;没办法改用第三方模…

在winform中使用程序读取和修改App.config里面的appSettings当中的Value值

一&#xff0c;命名空间 using System; using System.Configuration; using System.Xml; 二&#xff0c;方法 //读取Value值 public static string GetConfigString(string key) { // // TODO: 在此处添加构造函数逻辑 // return ConfigurationSettings.AppSettings[key]…