2016年3月10日 星期四

[javascript]windown.open 新視窗 置中

 $(function () {
        $("#Query").click(function () {
             //視窗的垂直位置 600是height
            var Top = (window.screen.availHeight - 30 - 600) / 2;  

            //視窗的水平位置 450 是 width
            var Left = (window.screen.availWidth - 10 - 450) / 2;
   
            window.open('@Url.Action("QueryMainPageID")', "搜尋官網ID", 
            config = "innerheight=600,innerwidth=800,top=" + Top + ",left=" + Left);
        });

沒有留言:

張貼留言