Giter Site home page Giter Site logo

digits88 / jposhload Goto Github PK

View Code? Open in Web Editor NEW

This project forked from martinkr/jposhload

0.0 1.0 0.0 685 KB

jPosload: an animated preloader, showing percentages. Similar to the well known flash preloaders

Home Page: http://jquery.public.mkrause.info/

License: Other

JavaScript 100.00%

jposhload's Introduction

jPoshLoad

jPoshLoad is an advanced animated preloader - think of flash-ish preloading.

API

	jQuery.fn.jPoshLoad({ID as String}, {
			images : {An Array of Strings pointing to your image sources}, // required!
			forceNoCache: {Boolean, set to true if you want to prevent image caching}, // optional, default: false
			// set custom properties which will be passed to all your functions, e.g. custom text
			headline: 'My First Loader' // << pass custom properties
			text: ' ...'
		});

jQuery.fn.jPoshLoad.getStatus

Returns the number of images still not loaded completely

  • @param {String} sIdLoader_ Completed loader's id
  • @return {Number} Images left to load

jQuery.fn.jPoshLoad.getStatus

  • Check if a specific loader is done with loading
  • @param {String} sIdLoader_ Completed loader's id
  • @return {Bool}

Example

	jQuery(document).ready(function(){

		jQuery.fn.jPoshLoad('LoaderOne', {
			images : ['src1','src2'],
			forceNoCache: true,
			headline: 'My First Loader'
		});

		jQuery.fn.jPoshLoad('LoaderTwo', {
			images : ['src3','src4'],
			forceNoCache: true,
			headline: 'My Second Loader'
		});

	})

Override these functions to match your page

$.fn.jPoshLoad.onComplete

Executed when all elements are completed. Add some code that removes or hides your laoder and starts your application.

  • @param {String} sIdLoader_ the completed loader's id
  • @param {jQuery-Element} elWrapper_ HTML-loader's wrapper element
  • @return {Void}

$.fn.jPoshLoad.updateStatus

Updates the loader's status Add some code to match your loader, e.g. update the text (2 of 10, 20%, etc) or play an animation.

  • @param {Object} oOptions_ the current loaders properties {sIdLoader, iTotal, iLoaded, $elWrapper}
  • @return {Void}

$.fn.jPoshLoad.updateStatus

Creates HTML elements for the preloader This Element will be stored and passed to you later on (updateStatus, onComplete).

  • @param {String} sIdLoader_ the current loader's id
  • @param {Object} oOptions_ the current loader's options
  • @return {jQuery-Element} It is important to return the loader's html wrapper. This will be stored and passed to you later (updateStatus etc).

Requires

License

Dual licensed under the MIT and GPL licenses.

Copyright (c) 2011-2014 Martin Krause (martinkr.github.io)

jposhload's People

Contributors

martinkr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.