# Return to cover image on video box when not hovering

**URL:** <https://forum.wixstudio.com/t/return-to-cover-image-on-video-box-when-not-hovering/48565>\
**Category:** Ask the community\
**Created:** [January 10, 2021, 8:06pm UTC](https://forum.wixstudio.com/t/return-to-cover-image-on-video-box-when-not-hovering/48565 "2021-01-10T20:06:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gswood92](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/gswood92/32/26032_2.png) [@gswood92](https://forum.wixstudio.com/u/gswood92)\
**Post date:** [January 10, 2021, 8:06pm UTC](https://forum.wixstudio.com/t/return-to-cover-image-on-video-box-when-not-hovering/48565/1 "2021-01-10T20:06:00Z")

</div>

I’m wondering if it is possible to have it so that when a user is not hovering over a video (and therefore playing the video, in my case) the coveer image is restored rather than just pausing the video, how do you get cover images to come back once you’ve uncovered them?  
Sorry if this has been asked before.

---

<div class="post-metadata">

**Author:** ![shirim](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/shirim/32/25419_2.png) [@shirim](https://forum.wixstudio.com/u/shirim)\
**Post date:** [January 12, 2021, 2:09pm UTC](https://forum.wixstudio.com/t/return-to-cover-image-on-video-box-when-not-hovering/48565/2 "2021-01-12T14:09:58Z")

</div>

Hey @gswood92 ,  
I’m Shiri from the Editor X team.  
Thank you for raising this question. At the moment this option is not available. Nevertheless, this is a great idea. We made a note of your requirement, and will consider it for our plans.

---

<div class="post-metadata">

**Author:** ![md60th](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/md60th/32/14986_2.png) [@md60th](https://forum.wixstudio.com/u/md60th)\
**Post date:** [January 12, 2021, 10:58pm UTC](https://forum.wixstudio.com/t/return-to-cover-image-on-video-box-when-not-hovering/48565/3 "2021-01-12T22:58:25Z")

</div>

There’s a way to fake it.  
Here is an example:

You can use this code example:

```javascript
$w.onReady(function () {
 
     const image = $w('#your_image_id');
     const video = $w('#your_video_id');

    image.onClick(() => {  
        video.play();
        image.hide('fade', {duration: 500});
    });

    video.onEnded(() => {
        image.show('fade', {duration: 500});
    });

    video.onPause(() => {
        image.show('fade', {duration: 500});
    });

});

```

If you want it on hover you can use this one:

```javascript
$w.onReady(function () {
 
 const image = $w('#your_image_id');
 const video = $w('#your_video_id');
 
    image.onMouseIn(() => {
        video.play();
        image.hide('fade', {duration: 500});
    });

    video.onMouseOut(() => {
        video.pause();
    });

    video.onEnded(() => {
        image.show('fade', {duration: 500});
    });

    video.onPause(() => {
        image.show('fade', {duration: 500});
    });
 
});

```

---

<div class="post-metadata">

**Author:** ![RemiZ](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/remiz/32/96167_2.png) [@RemiZ](https://forum.wixstudio.com/u/RemiZ)\
**Post date:** [October 28, 2024, 12:16am UTC](https://forum.wixstudio.com/t/return-to-cover-image-on-video-box-when-not-hovering/48565/4 "2024-10-28T00:16:03Z")

</div>

And how do you apply this code 😃 ? Ive started using wix studio Today… Barely getting grasp of anything but this sounds like a solution i need. Would appreciate a little more detailed instruction. All i need is Image that start playing video when hover and then goes back to image when mouse is outside. This works perfectly in Wix Editor… Don’t understand why not in the studio as well.
