# Creating a Delayed onMouseEnter Popup Action

**URL:** <https://forum.inductiveautomation.com/t/creating-a-delayed-onmouseenter-popup-action/36790>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [July 16, 2020, 5:35pm UTC](https://forum.inductiveautomation.com/t/creating-a-delayed-onmouseenter-popup-action/36790 "2020-07-16T17:35:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickbartsch](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nickbartsch](https://forum.inductiveautomation.com/u/nickbartsch)\
**Post date:** [July 16, 2020, 5:35pm UTC](https://forum.inductiveautomation.com/t/creating-a-delayed-onmouseenter-popup-action/36790/1 "2020-07-16T17:35:27Z")

</div>

Hello,

I’m trying to create a tooltip for a component which will popup when your mouse hovers over the component and close when the mouse moves off the component. I have successfully implemented this using the onMouseEnter and onMouseLeave popup event scripts.

However, with this if you quickly move your cursor across the screen and happen to hover over the component in the process, the tooltip will quickly flash on the screen. This is a rather minor inconvenience but is there a way to modify these popup events so the mouse must hover over the component for a fixed amount of time (say 0.3 seconds) before popping up to avoid this?

Thanks,  
Nick

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [July 16, 2020, 6:09pm UTC](https://forum.inductiveautomation.com/t/creating-a-delayed-onmouseenter-popup-action/36790/2 "2020-07-16T18:09:49Z")

</div>

Idk if its right. But I make the event call a method that uses

time.sleep()

To do that. It works well for me.

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [July 16, 2020, 6:38pm UTC](https://forum.inductiveautomation.com/t/creating-a-delayed-onmouseenter-popup-action/36790/3 "2020-07-16T18:38:21Z")

</div>

~~@pturmel is going to show up soon to tell you (correctly of course) of the horrors of time.sleep(). Don’t use that. Sorry to not be much help, but time.sleep() is almost certainly not the right solution.~~

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [July 16, 2020, 6:44pm UTC](https://forum.inductiveautomation.com/t/creating-a-delayed-onmouseenter-popup-action/36790/4 "2020-07-16T18:44:11Z")

</div>

😆  
Not the first time he will have gotten on to me!

It runs on the gateway tho!

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [July 16, 2020, 6:47pm UTC](https://forum.inductiveautomation.com/t/creating-a-delayed-onmouseenter-popup-action/36790/5 "2020-07-16T18:47:55Z")

</div>

> [@Perspective: How to delay script run to close dock in x seconds](http://forum.inductiveautomation.com/t/perspective-how-to-delay-script-run-to-close-dock-in-x-seconds/26741/10):
>
> Ah, I forgot this entire thread was about delaying the action! What I would do is include the delay as part of the project script as an optional argument and just sleep that long before executing the rest of the script.

I stand corrected.
