JS中window.open彈出窗口居中
利用下麵這個js函數可以使window.open彈出的窗口居中function openwindow(url,name,iWidth,iHeight)
{
var url; //轉向網頁的地址;
var name; //網頁名稱,可為空;
var iWidth; //彈出窗口的寬度;
var iHeight; //彈出窗口的高度;
var iTop = (window.screen.availHeight-30-iHeight)/2; //獲得窗口的垂直位置;
var iLeft = (window.screen.availWidth-10-iWidth)/2; //獲得窗口的水平位置;
window.open(url,name,'height='+iHeight+',,innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
}
<a href="javascript:void(0);" >轉到</a>
原帖地址:https://ehaidao.blog.163.com/blog/static/139876521201032844a34485/
最後更新:2017-04-03 20:19:18
上一篇:
數據庫中創建索引的準則
下一篇:
ComBox控件下拉框選項的添加
AJAX入門--- XMLHttpRequest對象的屬性和方法
海量用戶實時定位和圈人 - 團圓社會公益係統(位置尋人\圈人)
Activity的intent詳解~
coco2d-x 紋理研究
vmware安裝係統注意點
oracle數據庫同步技術
深度學習的IR“之爭”
httpclient3.0 上傳文件名及field中文解決方法
android Universal Image Loader for Android 說明文檔 (1)
WinForm中提示Circular base class dependency involving 'TestEncryption.Form' and 'TestEncryption.Form