<input id="txtElect" runat="server" onclick="show_dialog3('ElectInfo.aspx?value='+document.getElementById('ctl00_ContentPlaceHolder1_txt3').value,620,470)"
在页面中调用 js
function show_dialog3(url,width,height){
var wt=(document.documentElement.clientHeight-height)/2;
var wl=(document.body.clientWidth-width)/2;
var wh = document.documentElement.scrollTop;
//alert(wh);
var body_width=document.body.scrollWidth+'px';
var body_height=document.documentElement.scrollHeight+wh+'px';
//alert(body_width);
var bg_obj = createDiv("show_bg","#D5D5D5","0px","0px","absolute",body_width,body_height,"999");
bg_obj.style.top = '0px';
bg_obj.style.left = '0px';
bg_obj.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=60,finishOpacity=100,style=0)';
bg_obj.style.opacity = 0.8;
document.body.appendChild(bg_obj);
dvs = createDiv("show_dialog","#ffffff","0px","0px","absolute","0px","0px","1000");
dvs.style.top=wt+wh+'px';
dvs.style.left = wl+'px';
dvs.style.border="2px solid #3366bb";
dvs.style.width = width+10;
dvs.style.height = height+80;
dvs.style.textAlign="center";
document.body.appendChild(dvs);
dvs.innerHTML='<div style="background-color:#3366bb;width:'+width+'px;padding:10px 5px 5px 5px;height:20px;"><div style="float:left;color:#FFFFFF;overflow:hidden;text-align:left;font-weight:bold;></div>'
+'<div style="float:right;></div>'
+'<div style="float:right;overflow:hidden;text-align:left;font-weight:bold;"><a href="javascript:void(0);" onclick="close_dialog()" style="color:#ffffff;text-decoration:none;"> 关闭 </a></div></div>'
+'<div style="background-color:#ffffff;width:'+width+'px;padding:5px;"><iframe id="frame1" marginheight="0" marginwidth="0" frameborder="0" scrolling="auto" width="'+(width)+'px" height="'+(height)+'px" src="'+url+'"></iframe><br/><input type="button" onclick="getselect3()" value="确定"/></div>';
}
function getselect3()
{
document.getElementById("ctl00_ContentPlaceHolder1_txtElect").value=document.getElementById("frame1").contentWindow.document.getElementById("TextBox1").value;
document.getElementById("ctl00_ContentPlaceHolder1_txt3").value=document.getElementById("frame1").contentWindow.document.getElementById("HiddenField1").value;
close_dialog();
}
在页面中调用 js
function show_dialog3(url,width,height){
var wt=(document.documentElement.clientHeight-height)/2;
var wl=(document.body.clientWidth-width)/2;
var wh = document.documentElement.scrollTop;
//alert(wh);
var body_width=document.body.scrollWidth+'px';
var body_height=document.documentElement.scrollHeight+wh+'px';
//alert(body_width);
var bg_obj = createDiv("show_bg","#D5D5D5","0px","0px","absolute",body_width,body_height,"999");
bg_obj.style.top = '0px';
bg_obj.style.left = '0px';
bg_obj.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=60,finishOpacity=100,style=0)';
bg_obj.style.opacity = 0.8;
document.body.appendChild(bg_obj);
dvs = createDiv("show_dialog","#ffffff","0px","0px","absolute","0px","0px","1000");
dvs.style.top=wt+wh+'px';
dvs.style.left = wl+'px';
dvs.style.border="2px solid #3366bb";
dvs.style.width = width+10;
dvs.style.height = height+80;
dvs.style.textAlign="center";
document.body.appendChild(dvs);
dvs.innerHTML='<div style="background-color:#3366bb;width:'+width+'px;padding:10px 5px 5px 5px;height:20px;"><div style="float:left;color:#FFFFFF;overflow:hidden;text-align:left;font-weight:bold;></div>'
+'<div style="float:right;></div>'
+'<div style="float:right;overflow:hidden;text-align:left;font-weight:bold;"><a href="javascript:void(0);" onclick="close_dialog()" style="color:#ffffff;text-decoration:none;"> 关闭 </a></div></div>'
+'<div style="background-color:#ffffff;width:'+width+'px;padding:5px;"><iframe id="frame1" marginheight="0" marginwidth="0" frameborder="0" scrolling="auto" width="'+(width)+'px" height="'+(height)+'px" src="'+url+'"></iframe><br/><input type="button" onclick="getselect3()" value="确定"/></div>';
}
function getselect3()
{
document.getElementById("ctl00_ContentPlaceHolder1_txtElect").value=document.getElementById("frame1").contentWindow.document.getElementById("TextBox1").value;
document.getElementById("ctl00_ContentPlaceHolder1_txt3").value=document.getElementById("frame1").contentWindow.document.getElementById("HiddenField1").value;
close_dialog();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货