Hi there,
I would like to avoid the jumping of images when the app is loaded for the first time.
Is there a way to have the "Loading" page shown to the user until all images are loaded and show the entire app when everything is ready? I am using React demo2.
Thanks for your help!
Tamas
Juvederm Ultra 3 is a game-changer for anyone looking to achieve smoother skin and fuller lips. It's particularly effective for moderate to deep wrinkles, providing a natural and youthful look that lasts. The versatility of this filler makes it an excellent choice for those wanting to enhance their facial features without looking overdone. Have you experienced the benefits of https://pdcosmetics.com/product/juvederm-ultra-3/? I'd love to hear about your results and any tips you might have for those considering this treatment!
Hi Lauris,
Thank for this, will try it out.
How would one detect if all assets and images are already loaded by the app before disabling the splashScreen? It seems that the background and some other images take more time while the components are already rendered and shown so there is a jumping of content on the page.
Thanks a lot!
Tamas
Hi Tamas,
Sorry for the late reply.
There is no built-in way to check that all images are loaded, you can check how many seconds it takes a page to be fully loaded with all images and then set loading timeout using setTimout
function.
You can trigger the load of a separate image is loaded using onLoad
event.
import React, { SyntheticEvent } from "react";
const App = () => {
const handleEvent = (e: SyntheticEvent<HTMLDivElement>) => {
// remove splash screen
};
return <div src="/img.png" onLoad={handleEvent}>{/** Some code */}</div>;
};
export default App;
Hi,
You can use the functions below to enable and disable splash screen in Metronic React version.
const enableSplashScreen = () => {
const splashScreen = document.getElementById("splash-screen")
if (splashScreen) {
splashScreen.style.setProperty("display", "flex")
}
}
const disableSplashScreen = () => {
const splashScreen = document.getElementById("splash-screen")
if (splashScreen) {
splashScreen.style.setProperty("display", "none")
}
}