# Dynamic Popup Positioning

**URL:** <https://forum.inductiveautomation.com/t/dynamic-popup-positioning/8637>\
**Category:** Ignition\
**Created:** [June 29, 2014, 3:08am UTC](https://forum.inductiveautomation.com/t/dynamic-popup-positioning/8637 "2014-06-29T03:08:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tjcorbin](https://avatars.discourse-cdn.com/v4/letter/t/45deac/32.png) [@tjcorbin](https://forum.inductiveautomation.com/u/tjcorbin)\
**Post date:** [June 29, 2014, 3:08am UTC](https://forum.inductiveautomation.com/t/dynamic-popup-positioning/8637/1 "2014-06-29T03:08:25Z")

</div>

Hi,

Running a script on click to open a popup window.

The clicked component is located within a template, which is placed in a window.

event.getY() gives me where I click within the component itself  
event.source.getY() gives me 0 - not handy  
event.source.parent.getY() gives me 0 - not handy  
event.source.getLocationOnScreen().y gives me the vertical position from the top of the screen, although my application is a window, somewhere on that screen.

questions

1. how to I find the Y position of the current window
2. how do I find the Y position of the template, which contains the clicked component

Thanks

Tim

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [June 29, 2014, 5:56pm UTC](https://forum.inductiveautomation.com/t/dynamic-popup-positioning/8637/2 "2014-06-29T17:56:30Z")

</div>

Here you go:

To get the Y position of the current window:

```auto
print system.gui.getParentWindow(event).y
```

To get the Y position of the template:

```auto
print event.source.parent.parent.y
```
