惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
Recent Announcements
Recent Announcements
H
Help Net Security
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
有赞技术团队
有赞技术团队
小众软件
小众软件
Last Week in AI
Last Week in AI
U
Unit 42
Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
H
Hackread – Cybersecurity News, Data Breaches, AI and More
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale
云风的 BLOG
云风的 BLOG
V
V2EX
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
博客园 - 三生石上(FineUI控件)
阮一峰的网络日志
阮一峰的网络日志
爱范儿
爱范儿

博客园 - shcity

Troubleshooting on TransactionScope Parse string to JSON object Parse date in js blockUI doesn't close when download file in asp.net define namespace in JS Dense_Rank(), Row_Number(), Rank() in sql server reading and writing variable through lock in SSIS script task Fix the issue that cannot open SSIS in BIDS three ways creating custom helpers to show RadioButtonList in MVC using JavaScriptSerializer to serialize object to json using ISerializable to control serialization and deserialization ViewStateAutoManager ReportingService formatting Build my own DataTable split a string into an array through comma 正则表达式替换日期 半透明的div对话框 foreach 的自动转化类型 在Ajax1.0中调用页面CS文件中的方法
div with separated html template - shcity
shcity · 2011-01-24 · via 博客园 - shcity

代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    
<title></title>
    
<script>
        
function setSize(div, innerDiv) {
            
var doc = document.documentElement;
            
var sw = parseFloat(doc.scrollWidth);
            
var cw = parseFloat(doc.clientWidth);
            
var sh = parseFloat(doc.scrollHeight);
            
var ch = parseFloat(doc.clientHeight);

            div.style.width 

= sw >= cw ? sw : cw;
            div.style.height 
= sh >= ch ? sh : ch;

            innerDiv.style.display 

= '';
            innerDiv.style.left 
= parseFloat(doc.scrollLeft) + cw / 2 - parseFloat(innerDiv.clientWidth) / 2;
            innerDiv.style.top 
= parseFloat(doc.scrollTop) + ch / 2 - parseFloat(innerDiv.clientHeight) / 2;

        }

function openNewWindow() {
            
var div = document.getElementById("container");
            
var innerDiv = document.getElementById("content");
            setSize(div, innerDiv);

            window.attachEvent(

"onresize"function() { setSize(div, innerDiv) });
            window.attachEvent(
"onscroll"function() { setSize(div, innerDiv) }); 

        }

function closeWindow() {
            
var div = document.getElementById("container");
            
var innerDiv = document.getElementById("content");
            div.style.width 
= 0;
            div.style.height 
= 0;
            innerDiv.style.display 
= 'none';
        }
        
        
function Button1_onclick() {
            openNewWindow();
        }
</script>
</head>
<body>
    
<div id="container" style="filter: alpha(opacity=40); position: absolute; top: 0px;
        left: 0px; z-index: 9998; background: black"
>
    
</div>
    
<div id="content" style="height: 200px; width: 300px; position: absolute;
        display: none; z-index: 9999;"
>
        
<div style="text-align: center; background-color: Gray;border:solid 1px gray">
            
<iframe style="border-style: none; width: 100%; height: 100%;" frameborder="0">
            
</iframe>            
            
<button onclick="closeWindow();">
                close
</button>
        
</div>
    
</div>
    
<p>
        
<input id="Button1" type="button" value="button" onclick="return Button1_onclick()" /></p>
</body>
</html>