Hi Chaim, thank you for your response.
" #imgPreloader " is indeed a HTML element that contains HTML and CSS to display the anitmation.
I have pasted the page code below to explain how the ShowLoadingCSS( ) and HideLoadingCSS( ) are triggered.
“#imgPreloader” = The HTML Preloader
“#repeater1” = The website image of the website displayed on the iMac
// For full API documentation, including code examples, visit http://wix.to/94BuAAs
import wixData from 'wix-data';
var prvSelection = "#btnAll";
$w.onReady( () => {
$w("#dataset1").onReady( () => {
SetSeeMoreButtonDisplay($w);
} );
} );
export function ShowLoadingCSS($w)
{
$w("#repeater1").hide().then(() => {
$w("#imgPreloader").show();
});
}
export function HideLoadingCSS($w)
{
$w("#imgPreloader").hide().then(() => {
$w("#repeater1").show();
});
}
// Show or hide the 'See More' button based on whether or not there are more results waiting
export function SetSeeMoreButtonDisplay($w)
{
if($w("#dataset1").getTotalCount() > $w("#repeater1").data.length)
$w("#btnSeeMore").show();
else
$w("#btnSeeMore").hide();
}
export function SelectCategory($w, _prevSelection, filter, category)
{
$w(prvSelection).enable();
prvSelection = _prevSelection;
$w(_prevSelection).disable();
$w("#btnSeeMore").hide();
ShowLoadingCSS($w);
$w("#dataset1").setFilter(wixData.filter()
.contains(filter, category)
);
$w("#dataset1").refresh().then ( () => {
// Reset 'See More' button
SetSeeMoreButtonDisplay($w);
HideLoadingCSS($w);
});
}
export function btnAll_click(event, $w) {
SelectCategory($w, "#btnAll", "category", "all");
}
export function btnEcommerce_click(event, $w) {
SelectCategory($w, "#btnEcommerce", "category", "ecommerce");
}
export function btnBranding_click(event, $w) {
SelectCategory($w, "#btnBranding", "category", "branding");
}
export function btnCopywriting_click(event, $w) {
SelectCategory($w, "#btnCopywriting", "category", "copywriting");
}
export function btnRedesign_click(event, $w) {
SelectCategory($w, "#btnRedesign", "category", "redesign");
}
export function btnWixcode_click(event, $w) {
SelectCategory($w, "#btnWixcode", "category", "wixcode");
}
export function btnActivate_mouseIn(event, $w) {
$w("#txtTitle").show();
$w("#txtDetails").show();
$w("#boxShade").show();
}
export function btnActivate_mouseOut(event, $w) {
$w("#txtTitle").hide();
$w("#txtDetails").hide();
$w("#boxShade").hide();
}
export function btnSeeMore_click(event, $w) {
$w("#dataset1").loadMore().then( () => {
SetSeeMoreButtonDisplay($w);
});
}
My website link is https://www.tobymcdowell.com/portfolio/ but for now I have hidden the HTML element behind the repeater so that it is only displayed when the repeater is loading.
Thank you