# How to restrict pop-up to open out side of window

**URL:** <https://forum.inductiveautomation.com/t/how-to-restrict-pop-up-to-open-out-side-of-window/34198>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [April 24, 2020, 2:21pm UTC](https://forum.inductiveautomation.com/t/how-to-restrict-pop-up-to-open-out-side-of-window/34198 "2020-04-24T14:21:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![doshinikhil](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@doshinikhil](https://forum.inductiveautomation.com/u/doshinikhil)\
**Post date:** [April 24, 2020, 2:21pm UTC](https://forum.inductiveautomation.com/t/how-to-restrict-pop-up-to-open-out-side-of-window/34198/1 "2020-04-24T14:21:07Z")

</div>

Ignition v8.0.9  
OS - Windows Server 2012 R2

Hi…I have checked some topics on forum and tried following script to get mouse position and change the location of pop-up window.

Pop-up Window W = 333 & H = 270

\*\*\*\*\*\*\*\*\*\* Script - Mouse Released \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

windowParent = system.gui.getParentWindow(event)  
point = windowParent.mousePosition  
x = int(point.getX())  
y = int(point.getY())  
xOffset = 110  
yOffset = 100

param1 = event.source.parent.getComponent(‘TagLabel’).text

if ((x + xOffset + 333 \> 1920) or (y + yOffset + 270 \> 1010)) :  
window = system.nav.openWindowInstance(‘Control Modules/a0\_AnalogIn’, {‘Tag’ : param1})   
system.nav.centerWindow(window)  
else:   
window = system.nav.openWindowInstance(‘Control Modules/a0\_AnalogIn’, {‘Tag’ : param1})   
window.setLocation(x + xOffset, y + yOffset)

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* END\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

I put object/template near to window border from which I am opening pop-up. But my pop-up is opening outside of windows. And my window has a scroll bar.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/d14e90b5ee5521bdc2579e2a00acce537cfe9a70.png)

I think I am doing some mistakes in script or project settings.
