# Preload window - Spinning wheel

**URL:** <https://forum.wixstudio.com/t/preload-window-spinning-wheel/65505>\
**Category:** Ask the community\
**Tags:** question, code, wix\
**Created:** [December 9, 2024, 7:12pm UTC](https://forum.wixstudio.com/t/preload-window-spinning-wheel/65505 "2024-12-09T19:12:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![user3410](https://avatars.discourse-cdn.com/v4/letter/u/db5fbb/32.png) [@user3410](https://forum.wixstudio.com/u/user3410)\
**Post date:** [December 9, 2024, 7:12pm UTC](https://forum.wixstudio.com/t/preload-window-spinning-wheel/65505/1 "2024-12-09T19:12:04Z")

</div>

**Question:**

Hello everyone,

Is there a solution to have a window (or just a picture) that uses a GIF (for example of a spinning wheel) when the user moves from one page to another.  
This would allow him to know that “his click” has been validated, and to avoid him pressing the button several times.  
A preloading window for the next page waiting to open somehow?

Thanks a lot for your answers.

**Product:**  
Wix Editor

---

<div class="post-metadata">

**Author:** ![Tech\_Voyager](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/tech_voyager/32/97093_2.png) [@Tech\_Voyager](https://forum.wixstudio.com/u/Tech_Voyager)\
**Post date:** [December 10, 2024, 1:52pm UTC](https://forum.wixstudio.com/t/preload-window-spinning-wheel/65505/2 "2024-12-10T13:52:34Z")

</div>

To achieve a preloading effect with a spinning GIF or similar visual feedback when navigating between pages, you can use a combination of CSS and JavaScript to create a loading spinner that appears when a user clicks on a button or link and disappears when the new page loads.

---

<div class="post-metadata">

**Author:** ![Sarfraz-Ahmad](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sarfraz-ahmad/32/116223_2.png) [@Sarfraz-Ahmad](https://forum.wixstudio.com/u/Sarfraz-Ahmad)\
**Post date:** [December 10, 2024, 3:55pm UTC](https://forum.wixstudio.com/t/preload-window-spinning-wheel/65505/3 "2024-12-10T15:55:53Z")

</div>

Just add this script code to wix site dashboard. You can change the spinning wheel background and other stuff to modify this code. Make sure add the code into the head and select for all the pages  
Here is the guide how you can:

> **[Wix Editor: Embedding Custom Code on Your Site | Help Center | Wix.com](https://support.wix.com/en/article/wix-editor-embedding-custom-code-on-your-site)**
>
> Embed custom code snippets to the head or body of your site's pages to verify site ownership, monitor your site's traffic, track user activity, and measure the

This is how it’s working to my site:

> **[Design Fluxio | Custom UX/UI Design for Startups](https://www.designfluxio.com/)**
>
> Design Fluxio – Wix UX/UI designer offering professional, custom, and responsive web design services. Elevate your brand with innovative, user-friendly websites tailored to your needs. Affordable and creative solutions for a seamless online...

 ![image](https://us1.discourse-cdn.com/wix/original/3X/9/f/9ff026f374d65094dff81425a2fff850d3bc8ec9.png)

 /\* Preloader Styles \*/ #preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #91934E; /\* Background color \*/ display: flex; justify-content: center; align-items: center; z-index: 9999; } /\* Spinner Animation \*/ .spinner { border: 12px solid #f3f3f3; border-top: 12px solid #000000; /\* Spinner border color \*/ border-radius: 50%; width: 80px; height: 80px; animation: spin 2s linear infinite; } /\* Spinner Keyframes \*/ @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

---

<div class="post-metadata">

**Author:** ![user3410](https://avatars.discourse-cdn.com/v4/letter/u/db5fbb/32.png) [@user3410](https://forum.wixstudio.com/u/user3410)\
**Post date:** [December 12, 2024, 7:39am UTC](https://forum.wixstudio.com/t/preload-window-spinning-wheel/65505/5 "2024-12-12T07:39:09Z")

</div>

Thanks everybody for your answers. i will look a that and try it.  
I will come back to tell you.

Have a nice day.

---

<div class="post-metadata">

**Author:** ![user3410](https://avatars.discourse-cdn.com/v4/letter/u/db5fbb/32.png) [@user3410](https://forum.wixstudio.com/u/user3410)\
**Post date:** [December 29, 2024, 9:08am UTC](https://forum.wixstudio.com/t/preload-window-spinning-wheel/65505/6 "2024-12-29T09:08:11Z")

</div>

Hello everybody,

I found a “solution” with a gif that appears when clicking on a button or other, but is there a way that the GIF (a spinning wheel) appears near of the cursor of the mouse when I click (by using the coordinates of the cursor)? ==\> (Moving the GIF everywhere on the page)

I use this code to retrieve the values of the coordinates of the mouse (And it works perfectly), but how to assign them to my GIF element? (called SpinningWheel)

> $w(‘#Catalogue’).onMouseIn((event) =\> {
> 
> let clientX = event.clientX;  
> let clientY = event.clientY;  
> let offsetX = event.offsetX;  
> let offsetY = event.offsetY;  
> let pageX = event.pageX;  
> let pageY = event.pageY;  
> let screenX = event.screenX;  
> let screenY = event.screenY;
> 
> })

Thank you…
