Loading Screens docuLoad - Download Add Loading Screens To Your Web App - docuLoad

Download Add Loading Screens To Your Web App – docuLoad

Posted on

This time I will share jQuery Plugin and tutorial about Add Loading Screens To Your Web App – docuLoad, hope it will help you in programming stack.

Loading Screens docuLoad - Download Add Loading Screens To Your Web App - docuLoad
File Size: 2.51 MB
Views Total: 1093
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

docuLoad is a jQuery plugin which adds a customizable, CSS3 powered loading screen to your web app.

The plugin adds a loading class to the body when the page stars loading, sets a timeout function so the loading screen has time to appear ideal for use with animations/ fading out the page etc, and removes the loading class when your page has fully loaded.

How to use it:

1. Add the loading class to the body tag.

1 <body class="loading">

2. Create an element for the loading screen.

1 <div class="loading-screen"></div>

3. Add jQuery library and the jQuery docuLoad plugin’s script to the webpage.

2         integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT"
3         crossorigin="anonymous">
4 </script>
5 <script src="js/docuLoad.js"></script>

4. Call the function on the internal links within the document.

1 $('a').docuLoad();

5. Customize the loading screen with the following CSS.

01 .loading-screen {
02   position: fixed;
03   width: 100%;
04   height: 100vh;
05   background: white;
06   top: 0;
07   left: 0;
08   right: 0;
09   bottom: 0;
10   z-index: -9998;
11   visibility: hidden;
12   transform: translateY(5%);
13   transition: all ease 1.2s;
14   opacity: 0;
15 }
16  
17 .loading .loading-screen {
18   transform: translateX(0%);
19   z-index: 9998;
20   visibility: visible;
21   opacity: 1;
22   transition: all ease 200ms;
23 }

6. If you want to override the default loading class.

1 $('a').docuLoad({
2   bodyLoadClass: 'loading'
3 });

7. Set the timeout in milliseconds. DO NOT SET THIS RIDICULOUSLY HIGH!! Remember less is more, people do not want to wait 5 seconds just to see your animation before being sent to the next page!

1 $('a').docuLoad({
2   timeOut: 240
3 });

8. By default, the plugin will wait for all images and JS to load before firing and can take a long time. So you may want to set windowLoad to false to trigger on document ready for a speedier response.

1 $('a').docuLoad({
2   windowLoad: false
3 });

This awesome jQuery plugin is developed by NatemcM. For more Advanced Usages, please check the demo page or visit the official website.

source : jquery.net