求网页弹窗控件 通常打开网页用window.open,这种方式打开的网页太不美观,求一个漂亮实用的网页弹窗控件,可以自定义窗口的width、height和标题。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 function OpenWindow(strFile,strTitle,theWidth,theHeight){//开窗 window.open(strFile,strTitle,"scrollbars=yes,toolbar=no,menubar=no,location=no,left=0,top=0,height="+theHeight+",width="+theWidth+",resizable=no");} 推荐下载:http://download.csdn.net/source/1392587 应该可以满足LZ你的要求 我也在用这个 里面的参数可以自己内定 而且图片那些都可以自己修改... var W = screen.width;//取得屏幕分辨率宽度var H = screen.height;//取得屏幕分辨率高度function M(id){return document.getElementById(id);//用M()方法代替document.getElementById(id)}function MC(t){return document.createElement(t);//用MC()方法代替document.createElement(t)};//判断浏览器是否为IEfunction isIE(){ return (document.all && window.ActiveXObject && !window.opera) ? true : false;} //取得页面的高宽function getBodySize(){ var bodySize = []; var div_leftContainer = M("leftContainer"); var div_rightContainer = M("rightContainer"); bodySize[0] = document.documentElement.clientWidth-20;//页面宽度 if(div_leftContainer.clientHeight>div_rightContainer.clientHeight) { bodySize[1]=div_leftContainer.clientHeight+50;// alert("clientHeight"+document.documentElement.clientHeight+"scrollTop"+document.documentElement.scrollTop); } else { bodySize[1]=div_rightContainer.clientHeight+50; } return bodySize;}//创建遮盖层function popCoverDiv(){if (M("cover_div")) {//如果存在遮盖层,则让其显示 M("cover_div").style.display = 'block';} else {//否则创建遮盖层var coverDiv = MC('div');document.body.appendChild(coverDiv);coverDiv.id = 'cover_div';with(coverDiv.style) { position = 'absolute'; background = '#444444'; left = '0px'; top = '0px'; var bodySize = getBodySize(); width = bodySize[0] + 'px' height = bodySize[1] + 'px'; zIndex = 0; if (isIE()) { filter = "Alpha(Opacity=60)";//IE逆境 } else { opacity = 0.6; }}}}function showloginerror(){ var div_title = M("divLogTitle"); div_title.style.display = "block";}//让要显示的页面显示为块 function showPage(){ var div_mainpop=M("div_mainpop"); div_mainpop.style.display = "block";}//设置DIV层的样式function change(){ var div_mainpop = M("div_mainpop"); div_mainpop.style.position = "absolute"; div_mainpop.style.border = "1px solid #CCCCCC"; var i=0;// var div_leftContainer = M("leftContainer");// var div_rightContainer = M("rightContainer"); var loginwight; var loginheight;//页面可视高度 loginwight=document.documentElement.clientWidth; loginheight=document.documentElement.clientHeight; popChange(i,loginwight,loginheight);}//让DIV层大小循环增大function popChange(i,loginwight,loginheight){ var div_mainpop = M("div_mainpop"); div_mainpop.style.left = (loginwight-i*i*2)/2+"px"; div_mainpop.style.top = (loginheight/2-i*i*0.75+document.documentElement.scrollTop)+"px"; div_mainpop.style.width = i*i*2 + "px"; div_mainpop.style.height = i*i*1.5+ "px"; if(i<=10){ i++; setTimeout("popChange("+i+","+loginwight+","+loginheight+")",10);//设置超时10毫秒 }}//打开DIV层function openset(obj){ change(); showLogin(); var module = Element.getAncesstorByClassName(obj, "module"); var moduleid = document.getElementsByClassName("hidden", module)[0]; M('moduleid').value=moduleid.value; var titile = document.getElementsByClassName("link", module)[0]; M('lb_poptop').innerText=titile.title; M('listCount').value=''; popCoverDiv() void(0);//不进行任何操作,如:<a href="#">aaa</a>}//关闭DIV层function closepop(){ M('div_mainpop').style.display = 'none'; M("cover_div").style.display = 'none';void(0);}<div id="div_main_panel">要显示的页面内容</div> lhgdialog打开不了.aspx动态页面 http://blog.csdn.net/xianfajushi/archive/2009/08/24/4480302.aspx换做法看 下载一个greybox 把js导入到项目中 <script type="text/javascript" src="greybox/AJS.js"></script> <script type="text/javascript" src="greybox/AJS_fx.js"></script> <script type="text/javascript" src="greybox/gb_scripts.js"></script> <script type="text/javascript" src="static_files/help.js"></script>后台调用 LinkButton1.Attributes.Add("onclick", "return GB_showCenter('修改密码', '../Default6.aspx?Id=" + id + "&page=" + CurPageIndex.ToString() + "',400,420)"); 关于重写URL的问题。大家来看 C#新建Execl关于单元格自动换行 好久没来了,散点技术分,问个SQL问题:如果快速获取当前排名? 不好意思,刚刚求SQL语句的,还有个条件,在线等 请问下面这段CSS是什么意思 为何我编写的asp.net的web项目只能在localhost下调试,不能在自己ip下调试 如何把用VS.NET 20003 写的ASP。NET 程序放在WIN2000里运行 一个新发现,顺便送100分 sql语句中的变量表示 当用select 的到的数据为空时,怎么返回自定的值,如0 讨论:控件参数和窗体参数 简单的sql语句
function OpenWindow(strFile,strTitle,theWidth,theHeight){//开窗
window.open(strFile,strTitle,"scrollbars=yes,toolbar=no,menubar=no,location=no,left=0,top=0,height="+theHeight+",width="+theWidth+",resizable=no");
}
应该可以满足LZ你的要求 我也在用这个
里面的参数可以自己内定
而且图片那些都可以自己修改...
var W = screen.width;//取得屏幕分辨率宽度
var H = screen.height;//取得屏幕分辨率高度function M(id){
return document.getElementById(id);//用M()方法代替document.getElementById(id)
}
function MC(t){
return document.createElement(t);//用MC()方法代替document.createElement(t)
};
//判断浏览器是否为IE
function isIE(){
return (document.all && window.ActiveXObject && !window.opera) ? true : false;
}
//取得页面的高宽
function getBodySize(){
var bodySize = [];
var div_leftContainer = M("leftContainer");
var div_rightContainer = M("rightContainer");
bodySize[0] = document.documentElement.clientWidth-20;//页面宽度
if(div_leftContainer.clientHeight>div_rightContainer.clientHeight)
{
bodySize[1]=div_leftContainer.clientHeight+50;
// alert("clientHeight"+document.documentElement.clientHeight+"scrollTop"+document.documentElement.scrollTop);
}
else
{
bodySize[1]=div_rightContainer.clientHeight+50;
}
return bodySize;
}
//创建遮盖层
function popCoverDiv(){
if (M("cover_div")) {
//如果存在遮盖层,则让其显示
M("cover_div").style.display = 'block';
} else {
//否则创建遮盖层
var coverDiv = MC('div');
document.body.appendChild(coverDiv);
coverDiv.id = 'cover_div';
with(coverDiv.style) {
position = 'absolute';
background = '#444444';
left = '0px';
top = '0px';
var bodySize = getBodySize();
width = bodySize[0] + 'px'
height = bodySize[1] + 'px';
zIndex = 0;
if (isIE()) {
filter = "Alpha(Opacity=60)";//IE逆境
} else {
opacity = 0.6;
}
}
}
}function showloginerror()
{
var div_title = M("divLogTitle");
div_title.style.display = "block";
}
//让要显示的页面显示为块
function showPage()
{
var div_mainpop=M("div_mainpop");
div_mainpop.style.display = "block";
}//设置DIV层的样式
function change(){
var div_mainpop = M("div_mainpop");
div_mainpop.style.position = "absolute";
div_mainpop.style.border = "1px solid #CCCCCC";
var i=0;
// var div_leftContainer = M("leftContainer");
// var div_rightContainer = M("rightContainer");
var loginwight;
var loginheight;//页面可视高度
loginwight=document.documentElement.clientWidth;
loginheight=document.documentElement.clientHeight;
popChange(i,loginwight,loginheight);
}
//让DIV层大小循环增大
function popChange(i,loginwight,loginheight){
var div_mainpop = M("div_mainpop");
div_mainpop.style.left = (loginwight-i*i*2)/2+"px";
div_mainpop.style.top = (loginheight/2-i*i*0.75+document.documentElement.scrollTop)+"px";
div_mainpop.style.width = i*i*2 + "px";
div_mainpop.style.height = i*i*1.5+ "px";
if(i<=10){
i++;
setTimeout("popChange("+i+","+loginwight+","+loginheight+")",10);//设置超时10毫秒
}
}//打开DIV层
function openset(obj)
{
change();
showLogin();
var module = Element.getAncesstorByClassName(obj, "module");
var moduleid = document.getElementsByClassName("hidden", module)[0];
M('moduleid').value=moduleid.value;
var titile = document.getElementsByClassName("link", module)[0];
M('lb_poptop').innerText=titile.title;
M('listCount').value=''; popCoverDiv()
void(0);//不进行任何操作,如:<a href="#">aaa</a>
}
//关闭DIV层
function closepop(){
M('div_mainpop').style.display = 'none';
M("cover_div").style.display = 'none';
void(0);
}<div id="div_main_panel">
要显示的页面内容
</div>
把js导入到项目中 <script type="text/javascript" src="greybox/AJS.js"></script>
<script type="text/javascript" src="greybox/AJS_fx.js"></script>
<script type="text/javascript" src="greybox/gb_scripts.js"></script>
<script type="text/javascript" src="static_files/help.js"></script>
后台调用 LinkButton1.Attributes.Add("onclick", "return GB_showCenter('修改密码', '../Default6.aspx?Id=" + id + "&page=" + CurPageIndex.ToString() + "',400,420)");