popup = window.open(thelink,'Facebook Share','resizable=1,status=0,location=0,width=500,height=300');
我想将这个窗口一直移动到中心(垂直和水平)
解决方法
Owalla,
我直接从谷歌搜索获得了这样的简单javascript,我们可以用更简单的方式在jquery中完成它但是尝试像这样
var myWindow; function openCenteredWindow(url) { var width = 400; var height = 300; var left = parseInt((screen.availWidth/2) - (width/2)); var top = parseInt((screen.availHeight/2) - (height/2)); var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top; myWindow = window.open(url,"subWind",windowFeatures); }