首页 > 解决方案 > PopupCenter 打开的按钮不回发

问题描述

您好我使用了来自 neofnd/popupCenter的Popupcenter 功能来打开aspx 页面。aspx 页面已打开,但 aspx 页面中的按钮不会触发,也不会回发。有人告诉我如何解决它。提前致谢。

有来自github的代码

function PopupCenter(url, title, w, h) {  
// Fixes dual-screen position                         Most browsers      Firefox  
var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left;  
var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top;  

width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;  
height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;  

var left = ((width / 2) - (w / 2)) + dualScreenLeft;  
var top = ((height / 2) - (h / 2)) + dualScreenTop;  
var newWindow = window.open(url, title, 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);  

// Puts focus on the newWindow  
if (window.focus) {  
    newWindow.focus();  

}  

}

有我的按钮打开调用这个功能。

标签: javascripthtml

解决方案


推荐阅读