All Projects → niklausgerber → Preloadme

niklausgerber / Preloadme

Licence: mit
PreLoadMe, a lightweight jQuery website preloader.

Projects that are alternatives of or similar to Preloadme

Percircle
⭕️ CSS percentage circle built with jQuery
Stars: ✭ 217 (-20.22%)
Mutual labels:  jquery-plugin, jquery
Js Offcanvas
A lightweight, flexible jQuery off-canvas navigation plugin which lets you create fully accessible sidebar or top/bottom sliding (or push) panels with keyboard interactions and ARIA attributes.
Stars: ✭ 272 (+0%)
Mutual labels:  jquery-plugin, jquery
Magnify
A lightweight jQuery magnifying glass zoom plugin.
Stars: ✭ 218 (-19.85%)
Mutual labels:  jquery-plugin, jquery
Jquery Aniview
A jQuery plugin that works in harmony with animate.css in order to enable animations only when content comes into view.
Stars: ✭ 205 (-24.63%)
Mutual labels:  jquery-plugin, jquery
Jquery Tablesort
A tiny & dead-simple jQuery plugin for sortable tables.
Stars: ✭ 254 (-6.62%)
Mutual labels:  jquery-plugin, jquery
Amaranjs
Nice, sleek and stylish notifications.
Stars: ✭ 214 (-21.32%)
Mutual labels:  jquery-plugin, jquery
Liteaccordion
A lightweight horizontal accordion plugin for jQuery.
Stars: ✭ 234 (-13.97%)
Mutual labels:  jquery-plugin, jquery
Tui.editor
🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
Stars: ✭ 14,016 (+5052.94%)
Mutual labels:  jquery-plugin, jquery
Email Autocomplete
A jQuery plugin that suggests and autocompletes the domain in email fields.
Stars: ✭ 265 (-2.57%)
Mutual labels:  jquery-plugin, jquery
Ajax Live Search
AJAX Live Search is a PHP search form that similar to Google Autocomplete feature displays the result as you type.
Stars: ✭ 238 (-12.5%)
Mutual labels:  jquery-plugin, jquery
Hc Offcanvas Nav
JavaScript library for creating toggled off-canvas multi-level navigations, allowing endless nesting of submenu elements, supporting swipe gestures, keyboard interactions and ARIA attributes.
Stars: ✭ 201 (-26.1%)
Mutual labels:  jquery-plugin, jquery
Modaal
An accessible dialog window library for all humans.
Stars: ✭ 2,702 (+893.38%)
Mutual labels:  jquery-plugin, jquery
Jquery Gantt
🌈 Lightweight jQuery gantt plugin.
Stars: ✭ 193 (-29.04%)
Mutual labels:  jquery-plugin, jquery
Bootstrap Checkbox
A checkbox component based on Bootstrap framework.
Stars: ✭ 214 (-21.32%)
Mutual labels:  jquery-plugin, jquery
Calx.js
jQuery Calx - a jQuery plugin for creating formula-based calculation form
Stars: ✭ 190 (-30.15%)
Mutual labels:  jquery-plugin, jquery
Jquery Multiselect
Turn a multiselect list into a nice and easy to use list with checkboxes.
Stars: ✭ 221 (-18.75%)
Mutual labels:  jquery-plugin, jquery
Bs grid
Bootstrap Datagrid
Stars: ✭ 184 (-32.35%)
Mutual labels:  jquery-plugin, jquery
Rangeslider.js
🎚 HTML5 input range slider element polyfill
Stars: ✭ 2,153 (+691.54%)
Mutual labels:  jquery-plugin, jquery
Jquery Viewer
A jQuery plugin wrapper for Viewer.js.
Stars: ✭ 235 (-13.6%)
Mutual labels:  jquery-plugin, jquery
Ziptastic Jquery Plugin
This is a jQuery plugin that shows how Ziptastic could be used.
Stars: ✭ 244 (-10.29%)
Mutual labels:  jquery-plugin, jquery

PreLoadMe, a lightweight jQuery website preloader

PreLoadMe is a lightweight preloader for any webcontent. Powered by jQuery and CSS it is fully responsive and will run on all modern desktop- and mobile browsers with no additionals plugins. PreLoadMe displays a loading animation until the browser fetched the whole webcontent and will fade out the moment the page has been completely chached. Because the simplicity of PreLoadMe, it can be easily customized and adapted to your needs.

PreLoadMe displays a loading animation until the browser fetched the whole web content and will fade out the moment the page has been completely cached. Because the simplicity of PreLoadMe, it can be easily customized and adapted to your needs.

You can see a live preview here: PreLoadMe Live Preview

Implementation

PreLoadMe is jQuery driven. You will need to implement an up to date jQuery version and the corresponding JavaScript for executing the preloader. Add the following code right before the </body> tag.

<!-- jQuery Plugin -->
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.3.min.js"></script>

<!-- Preloader -->
<script type="text/javascript">
    //<![CDATA[
        $(window).on('load', function() { // makes sure the whole site is loaded 
            $('#status').fadeOut(); // will first fade out the loading animation 
            $('#preloader').delay(350).fadeOut('slow'); // will fade out the white DIV that covers the website. 
            $('body').delay(350).css({'overflow':'visible'});
          })
    //]]>
</script>

The CSS-Markup will help you style the preloader. Make sure to include it on your website.

body {
	overflow: hidden;
}

/* Preloader */
#preloader {
	position: fixed;
	top:0;
	left:0;
	right:0;
	bottom:0;
	background-color:#fff; /* change if the mask should have another color then white */
	z-index:99; /* makes sure it stays on top */
}

#status {
	width:200px;
	height:200px;
	position:absolute;
	left:50%; /* centers the loading animation horizontally one the screen */
	top:50%; /* centers the loading animation vertically one the screen */
	background-image:url(../img/status.gif); /* path to your loading animation */
	background-repeat:no-repeat;
	background-position:center;
	margin:-100px 0 0 -100px; /* is width and height divided by two */
}

Finally place the following HTML Code directly after the <body> tag.

<!-- Preloader -->
<div id="preloader">
	<div id="status">&nbsp;</div>
</div>

The outer DIV preloader will be called from the CSS file and will cover the entire website with a white DIV. The inner DIV status will show the loading animation. Also you should not forget to give your document a proper doctype. Otherwise the preloader might not work.

Using with AJAX requests

If you want to show preloader during AJAX request you can use the following CSS code.

#preloader {
	position:fixed;
	left: 0px;
	top: 0px;
	width: 100%;
	height: 100%;		
	background-color:#fff; /* change if the mask should have another color then white */
	z-index:99; /* makes sure it stays on top */
}		

#status {
	width:200px;
	height:200px;
	position:absolute;
	left:50%; /* centers the loading animation horizontally one the screen */
	top:50%; /* centers the loading animation vertically one the screen */
	background-image:url(../img/status.gif); /* path to your loading animation */
	background-repeat:no-repeat;
	background-position:center;
	margin:-100px 0 0 -100px; /* is width and height divided by two */
}			

Your Javascript code will look like:

$("#status").fadeIn();
$("#preloader").fadeIn();
$.get(url, data, function(){
	$("#status").fadeOut();
	$("#preloader").fadeOut();
});

The source package contains all relevant files and a working demonstration.

Credits

Please support humans.txt (http://humanstxt.org/). It's an initiative for knowing the people behind a website. It's a TXT file that contains information about the different people who have contributed to building the website.

PreLoadMe: https://github.com/niklausgerber/PreLoadMe
Niklaus Gerber
Twitter: @niklausgerber
URL: https://www.niklausgerber.com
Location: Zürich, Switzerland

Download, Fork, Commit.

If you think you can make this better, please Download, Fork, & Commit. I'd love to see your ideas.

Donation

I love to create and I won't ask for repayment. If you appreciate my work and would like to support me I am sure you will earn some extra Karma points. Please donate.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].