Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

How to Make Full Screen Page Loader using JavaScript

javascript jquery
How to Make Full Screen Page Loader using JavaScript

When you search for a solution for full screen overlay, most website provides solutions using JavaScript or jQuery. The following solution is using CSS and JavaScript of jQuery. Here we are going to create a page loader window those overlays an existing html page and disabling all links and bringing into focus on the page loader window.

CSS code

.overlay {
    background: #e9e9e9;
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    opacity: 0.5;
#loader {
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    animation: spin 2s linear infinite;
    border-color: #3498db #f3f3f3 #f3f3f3;
    border-image: none;
    border-radius: 50%;
    border-style: solid;
    border-width: 16px;
    height: 120px;
    left: 50%;
    margin: -75px 0 0 -75px;
    position: absolute;
    top: 50%;
    width: 120px;
    z-index: 1;
@-webkit-keyframes spin {
  0% { -webkit-transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); }

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }

HTML code

<div id="loaderbg" style="position: fixed; top: 0px; left: 0px; background: rgba(0, 0, 0, 0.6) none repeat scroll 0% 0%;
	 z-index: 5; width: 100%; height: 100%; display: none;">
	<div id="loader"></div>

jQuery/JavaScript code

	function showPageloader() {
			document.getElementById("loaderbg").style.display = "";
	function hidePageloader() {
		document.getElementById("loaderbg").style.display = "none";



07 Dec 2018

Thank you so much sir Super Simple Javascript Code

Html code work in comment box

Related Post