Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 1830

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 62k
Author
Asked: November 25, 20242024-11-25T11:48:07+00:00 2024-11-25T11:48:07+00:00

Create a skeleton loading

  • 62k

Hello everyone, today we are going to take a look at a rather special method of loading content, in fact we are going to talk about skeleton loading, a method of loading pages that is quite widespread and quite original to make users wait while your page is loading. You are ready, so let's go !

What is it ?

But what does a page using skeleton loading look like? In fact, you see them on every platform: Twitter, YouTube, Netflix… Below you can see glimpses of skeleton loading on various websites mentioned above.

Youtube Skeleton Loading View

As you can see, skeleton loading is used by high profile sites for a reason: it allows the user to directly understand where and how the information will be organised after loading.

Let's code

Now we're going to start making a page that uses skeleton loading to present videos. Please note that if you want to use skeletons loading on your website, you will need to use an AJAX add-on to fully load the videos. In our case, we will implement the skeleton loading system, without loading real videos.

First we will write our HTML structure :

  <!-- This div is used as a container --> <div class="wrapper shine">   <!-- Title -->   <h2>Coming soon</h2>   <!-- Container of card (videos that load) -->   <div class="container">       <div class="card"></div>     <div class="card"></div>     <div class="card"></div>     <div class="card"></div>     <div class="card"></div>   </div>   <h2>Best sellers</h2>   <div class="container">     <div class="card"></div>     <div class="card"></div>     <div class="card"></div>     <div class="card"></div>     <div class="card"></div>   </div>   <h2>Recommended</h2>   <div class="container">     <div class="card"></div>     <div class="card"></div>     <div class="card"></div>     <div class="card"></div>     <div class="card"></div>     <div class="card"></div>     <div class="card"></div>     <div class="card"></div>     <div class="card"></div>     <div class="card"></div>   </div> </div>   
Enter fullscreen mode Exit fullscreen mode

Then we add some style :

  /* Fonts */ @import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap");  /* Style */ body {   background: #dedede; }  .wrapper {   width: 900px;   max-width: 95%;   margin: 55px auto; } .wrapper h2 {   color: white;   letter-spacing: 1px;   margin: 10px 0 5px 10px;   font-family: "Roboto", sans-serif; } .wrapper .container {   display: flex;   flex-wrap: wrap;   align-content: center;   justify-content: flex-start;   align-items: center;   flex-direction: row; } .wrapper .container .card {   margin: 10px;   width: 160px;   height: 90px;   border-radius: 3px;   background-image: linear-gradient(90deg, #e2e2e2 0px, #efefef 30px, #e2e2e2 60px);   background-size: calc(160px + 160px);   animation: refresh 1.2s infinite ease-out; }  /* Animation */ @keyframes refresh {   0% {     background-position: calc(-160px);   }   60%, 100% {     background-position: 160px;   } }   
Enter fullscreen mode Exit fullscreen mode

You can see the final result below :

If you want to load the video thumbnails, you will have to use AJAX. To do this, it is highly recommended to use jQuery which simplifies the requests and makes them more reliable. An example code in AJAX :

  html <script>   $(document).ready(function() {     $(".card").load("https://www.site.com/videoCharging.php");   }); </script>   
Enter fullscreen mode Exit fullscreen mode

I hope you enjoyed this tutorial, if you have any questions, feel free to ask me in the comments. 👍

codenewbiecsshtmlwebdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 2k
  • Popular
  • Answers
  • Author

    ES6 - A beginners guide - Template Literals

    • 0 Answers
  • Author

    Understanding Higher Order Functions in JavaScript.

    • 0 Answers
  • Author

    Build a custom video chat app with Daily and Vue.js

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.