# mouseOut wont work on container box?

**URL:** <https://forum.wixstudio.com/t/mouseout-wont-work-on-container-box/30500>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [October 22, 2020, 10:08am UTC](https://forum.wixstudio.com/t/mouseout-wont-work-on-container-box/30500 "2020-10-22T10:08:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![magicry85](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/magicry85/32/24293_2.png) [@magicry85](https://forum.wixstudio.com/u/magicry85)\
**Post date:** [October 22, 2020, 10:08am UTC](https://forum.wixstudio.com/t/mouseout-wont-work-on-container-box/30500/1 "2020-10-22T10:08:08Z")

</div>

Hi,

I have a button named “megamenu” which i want to show container box “box1” on mouse in event. This part works fine however when i mouseout of the box, the box stays in view until page reload. CAn’t understand why my code below isn’t working. Help please

```javascript
export function megamenu_mouseIn(event) {
$w('#box1').show();  
}

export function box1_mouseOut(event) {
$w('#box1').hide();
}

```

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [October 22, 2020, 3:05pm UTC](https://forum.wixstudio.com/t/mouseout-wont-work-on-container-box/30500/2 "2020-10-22T15:05:15Z")

</div>

Check the property panel and make sure the box1\_mouseOut is turned on there.

---

<div class="post-metadata">

**Author:** ![magicry85](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/magicry85/32/24293_2.png) [@magicry85](https://forum.wixstudio.com/u/magicry85)\
**Post date:** [October 22, 2020, 3:15pm UTC](https://forum.wixstudio.com/t/mouseout-wont-work-on-container-box/30500/3 "2020-10-22T15:15:12Z")

</div>

Hi, thanks for that but it is checked and still not working…

 ![](https://us1.discourse-cdn.com/wix/original/3X/1/e/1e25b456028c2a7fe059d516daeb3f17c3ff76c2.jpeg)

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [October 22, 2020, 6:00pm UTC](https://forum.wixstudio.com/t/mouseout-wont-work-on-container-box/30500/4 "2020-10-22T18:00:21Z")

</div>

@magicry85  
in your code you have: box1\_mouseOut while in the property panel it’s box1\_mouseOut **\_1** They must be the same in both places.

---

<div class="post-metadata">

**Author:** ![mrnevs](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/mrnevs/32/5651_2.png) [@mrnevs](https://forum.wixstudio.com/u/mrnevs)\
**Post date:** [October 30, 2020, 4:47pm UTC](https://forum.wixstudio.com/t/mouseout-wont-work-on-container-box/30500/5 "2020-10-30T16:47:32Z")

</div>

wix is frustrating on this, everytime you do this it ads “\_1”, you must make sure when you click the property panel you remove it each time. Sometime it also adds to the page code, a new part for what it should do on mouse out, even though its specified elsewhere…

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [October 31, 2020, 4:18pm UTC](https://forum.wixstudio.com/t/mouseout-wont-work-on-container-box/30500/6 "2020-10-31T16:18:19Z")

</div>

This is one of the reason I prefer to use $w(“#element”).onMouaseOut() instead of the export function element\_MouseOut() . it’s less error-prone.

---

<div class="post-metadata">

**Author:** ![mmaravillaa](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/mmaravillaa/32/26691_2.png) [@mmaravillaa](https://forum.wixstudio.com/u/mmaravillaa)\
**Post date:** [February 10, 2021, 7:45am UTC](https://forum.wixstudio.com/t/mouseout-wont-work-on-container-box/30500/7 "2021-02-10T07:45:21Z")

</div>

@jonatandor35 Thanks J.D. You saved me!

---

<div class="post-metadata">

**Author:** ![ahsan-butt786](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ahsan-butt786/32/33077_2.png) [@ahsan-butt786](https://forum.wixstudio.com/u/ahsan-butt786)\
**Post date:** [April 17, 2022, 3:41pm UTC](https://forum.wixstudio.com/t/mouseout-wont-work-on-container-box/30500/8 "2022-04-17T15:41:39Z")

</div>

Can someone please help me?

I have a vector image ‘info’ that i would like to add to my page. I have added it with a box named #screeninfo for the mouse in & mouse out code but cant get it to work  
Please see below my code, am i doing something wrong?

 ![](https://us1.discourse-cdn.com/wix/original/3X/1/4/146ebe782b2d3d2aad016a5f6fe6811a86a03a4e.jpeg)

---

<div class="post-metadata">

**Author:** ![noahlovell](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/noahlovell/32/118920_2.png) [@noahlovell](https://forum.wixstudio.com/u/noahlovell)\
**Post date:** [April 17, 2022, 5:16pm UTC](https://forum.wixstudio.com/t/mouseout-wont-work-on-container-box/30500/9 "2022-04-17T17:16:03Z")

</div>

Just commented on your own post with the answer.

You are missing the () at the end of the show and hide
