# How to open a lightbox on mousein?

**URL:** <https://forum.wixstudio.com/t/how-to-open-a-lightbox-on-mousein/35023>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [November 15, 2017, 7:43pm UTC](https://forum.wixstudio.com/t/how-to-open-a-lightbox-on-mousein/35023 "2017-11-15T19:43:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![greyhound72](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/greyhound72/32/1043_2.png) [@greyhound72](https://forum.wixstudio.com/u/greyhound72)\
**Post date:** [November 15, 2017, 7:43pm UTC](https://forum.wixstudio.com/t/how-to-open-a-lightbox-on-mousein/35023/1 "2017-11-15T19:43:59Z")

</div>

Hello,

Tried to open a lightbox when a mouse in to a element (button), but this doesn’t work for me. The code is as follows:  
import wixWindow from ‘wix-window’;  
export function button1\_mouseIn() {  
wixWindow.openLightbox(“lightbox2”);  
}

Can anyone help please?  
Thanks!  
Yury

---

<div class="post-metadata">

**Author:** ![andreas-kviby](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/andreas-kviby/32/790_2.png) [@andreas-kviby](https://forum.wixstudio.com/u/andreas-kviby)\
**Post date:** [November 15, 2017, 8:27pm UTC](https://forum.wixstudio.com/t/how-to-open-a-lightbox-on-mousein/35023/2 "2017-11-15T20:27:58Z")

</div>

Is lightbox2 the name of the lightbox or the id? It is the name of the lightbox you should pass into the function not the id.

---

<div class="post-metadata">

**Author:** ![mikhail-spirin-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/mikhail-spirin-wix/32/838_2.png) [@mikhail-spirin-wix](https://forum.wixstudio.com/u/mikhail-spirin-wix)\
**Post date:** [November 15, 2017, 8:32pm UTC](https://forum.wixstudio.com/t/how-to-open-a-lightbox-on-mousein/35023/3 "2017-11-15T20:32:37Z")

</div>

Hi Yury!  
Make sure youre using right name of lightbox. Confusingly (but mentioned in documentation), you sould use not id of the lightbox, but it’s name. Here - [2017-11-15\_1231](https://www.screencast.com/t/6ftrA82P)

Checked right now, it works for me…

---

<div class="post-metadata">

**Author:** ![greyhound72](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/greyhound72/32/1043_2.png) [@greyhound72](https://forum.wixstudio.com/u/greyhound72)\
**Post date:** [November 15, 2017, 8:42pm UTC](https://forum.wixstudio.com/t/how-to-open-a-lightbox-on-mousein/35023/4 "2017-11-15T20:42:59Z")

</div>

Oh well, I used ID… Thanks guys, and have a nice time 🙂  
Yury
