0

Is there a way to create Loadingbar on client side?

asked 2021-02-27 01:02:03 +0800

gvguad gravatar image gvguad
7 2

I have a script tag which contains next code

<script type="text/javascript">
    window.onload = function loadStuff() {
    var image = document.querySelector(".blurry-load");
    image.src = image.dataset.large
    image.onload = () => {
    image.classList.add("blur-out");
    image.classList.remove("blurry-load");
    };
    };
</script>

This code loads heavy background image and then replaces the lightweight version with this image. So it would be nice to show that something is loading

delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2021-02-27 01:02:03 +0800

Seen: 5 times

Last updated: Feb 27 '21

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More