---
title: "How to open popup window into screen center?"  
description: "How to open popup window into screen center?"  
author: "Anonymous User"  
published: 2012-11-01  
updated: 2012-11-01  
canonical: https://www.mindstick.com/forum/462/how-to-open-popup-window-into-screen-center  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# How to open popup window into screen center?

Hi,\
I'm working on [asp.net](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder), and i try to open a [popup](https://www.mindstick.com/blog/11734/how-to-create-advanced-popup-or-banners-with-news-images-discounts-in-magento2) [windows](https://www.mindstick.com/articles/311752/how-to-install-and-use-the-google-wifi-software-on-a-windows-or-mac-computer) into [screen](https://www.mindstick.com/forum/33644/loading-screen-during-ajax-call) middle. what i do?

## Replies

### Reply by AVADHESH PATEL

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);
    }
```


---

Original Source: https://www.mindstick.com/forum/462/how-to-open-popup-window-into-screen-center

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
