Loading indicator between pages?

I have a page within my site that has a lot of images +code and it takes a bit to load. (It works…)

But, I was trying to add a small “Loading” icon (#button66) to the previous page after a linked button(#button39) is clicked.

I’ve tried just doing .show() on a click event, and I’ve tried linking the button via code to see if it was trying to load the next page first, but neither is getting #button66 to appear:

import wixLocation from ‘wix-location’ ;

export function button39_click ( event ) {
$w ( “#button66” ). show ()
wixLocation . to ( “/neighbors-install-images” );

Please let me know if you have any tips!

So before the redirection actually happens, the new page won’t start loading. Therefore showing the pre-loader on the original page won’t help.

You can either add the pre-loader to the specific heavy elements (e.g. repeater) on the destination page (make them hidden/collapsed on load and display the pre-loader until the data loads). Then show the actual element and hide the preloader (for example inside the onItemReady event of the repeater).

Or add custom code (not Velo) in the dashboard (currently the only way to execute code before the page finished loading). Like mentioned in this or other similar forum posts.