HOW TO OPEN POPUP WINDOW INTO SCREEN CENTER?

Ankit Singh

Total Post:341

Points:2389
Posted by  Ankit Singh
 2311  View(s)
Ratings:
Rate this:
Hi,
I'm working on asp.net, and i try to open a popup windows into screen middle. what i do?
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: How to open popup window into screen center?

    use the JavaScript to open popup window in center.

    function popup(pageURL, title, popupWidth, popupHeight)  
        {
            var left = (screen.width / 2) - (popupWidth /  2);
            var top = (screen.height / 2) - (popupHeight / 2);
            var  targetPop = window.open(pageURL, title, 'toolbar=no, location=no,  directories=no, 
    status=no, menubar=no, scrollbars=YES, resizable=YES,  copyhistory=no, width=' + popupWidth + ', 
    height=' + popupHeight + ', top='  + top + ', left=' + left);
        }

      Modified On Mar-29-2018 05:30:34 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!