# How to create faded hover effects in Editor X?

**URL:** <https://forum.wixstudio.com/t/how-to-create-faded-hover-effects-in-editor-x/37154>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [September 12, 2020, 9:41pm UTC](https://forum.wixstudio.com/t/how-to-create-faded-hover-effects-in-editor-x/37154 "2020-09-12T21:41:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![contact86949](https://avatars.discourse-cdn.com/v4/letter/c/b4bc9f/32.png) [@contact86949](https://forum.wixstudio.com/u/contact86949)\
**Post date:** [September 12, 2020, 9:41pm UTC](https://forum.wixstudio.com/t/how-to-create-faded-hover-effects-in-editor-x/37154/1 "2020-09-12T21:41:31Z")

</div>

Hi,  
I’m new to Wix and this forum. I apologize in advance if this has been addressed already, I searched the forums for quite some time for an answer before posting this.

My issue is with creating simple faded hover effects for images in Editor X. I followed the example code below, and it works as long as I don’t move the mouse too fast.

My understanding is that new inputs are ignored during the fade “duration” timer, meaning that if I move the mouse out of the image(or Box1 in this case) during the first 500ms, onMouseOut will not trigger and the image will remain hidden. If I set the “duration” to 0ms it works every time, but I really want the smooth faded effect.

I hope someone has a solution or work around for this.

$w.onReady(function () {  
$w(‘#Image1’).onMouseIn( (Event) =\> {  
let fadeOptions = {  
“duration”: 500,  
“delay”: 100  
};  
$w(“#Image1”).hide(“fade”, fadeOptions);  
} );  
} );  
​  
export function Box1\_mouseOut(event) {  
let fadeOptions = {  
“duration”: 500,  
“delay”: 100  
};  
$w(“#Image1”).show(“fade”, fadeOptions);  
}

---

<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:** [September 13, 2020, 6:44am UTC](https://forum.wixstudio.com/t/how-to-create-faded-hover-effects-in-editor-x/37154/2 "2020-09-13T06:44:47Z")

</div>

I haven’t tried it, but I’d guess it’s ignored because you can‘t show() an element that is not hidden yet and vice versa.  
so you can try:  
//onMouseIn  
$w(“#image1”).hide();  
$w(“#image1”).show(fade, fadeOptions);  
//and the same idea for the other way.

---

<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:** [September 13, 2020, 6:48am UTC](https://forum.wixstudio.com/t/how-to-create-faded-hover-effects-in-editor-x/37154/3 "2020-09-13T06:48:08Z")

</div>

Alternatively, instead of show-hide methods you can use Wix-animations to make it transparent or opaque overtime.

---

<div class="post-metadata">

**Author:** ![contact86949](https://avatars.discourse-cdn.com/v4/letter/c/b4bc9f/32.png) [@contact86949](https://forum.wixstudio.com/u/contact86949)\
**Post date:** [September 13, 2020, 7:23am UTC](https://forum.wixstudio.com/t/how-to-create-faded-hover-effects-in-editor-x/37154/4 "2020-09-13T07:23:37Z")

</div>

It works perfect now, thanks! I’m sure you meant //onMouseOut (in case someone else stumbles across this)
