Skip to content

Commit

Permalink
added onLoadComplete event
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaya committed Dec 5, 2013
1 parent 6bbcd07 commit 8e06bdc
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "QueryLoader2",
"version": "2.8.2",
"version": "2.8.3",
"homepage": "http://www.gayadesign.com/diy/queryloader2-preload-your-images-with-ease/",
"authors": [
"Gaya <[email protected]>"
Expand Down
6 changes: 5 additions & 1 deletion jquery.queryloader2.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Version: 2.8.2
* Version: 2.8.3
* Last update: 2013-12-05
*/
(function($){function OverlayLoader(parent) {
Expand Down Expand Up @@ -190,6 +190,7 @@ function QueryLoader2(element, options) {
//The default options
this.defaultOptions = {
onComplete: function() {},
onLoadComplete: function() {},
backgroundColor: "#000",
barColor: "#fff",
overlayId: 'qLoverlay',
Expand Down Expand Up @@ -331,6 +332,9 @@ QueryLoader2.prototype.endLoader = function () {
};

QueryLoader2.prototype.onLoadComplete = function() {
//fire the event before end animation
this.options.onLoadComplete();

if (this.options.completeAnimation == "grow") {
var animationTime = this.options.minimumTime;

Expand Down
4 changes: 2 additions & 2 deletions jquery.queryloader2.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery.queryloader2",
"version": "2.8.2",
"version": "2.8.3",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-uglify": "~0.2.2",
Expand Down
4 changes: 4 additions & 0 deletions src/QueryLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function QueryLoader2(element, options) {
//The default options
this.defaultOptions = {
onComplete: function() {},
onLoadComplete: function() {},
backgroundColor: "#000",
barColor: "#fff",
overlayId: 'qLoverlay',
Expand Down Expand Up @@ -156,6 +157,9 @@ QueryLoader2.prototype.endLoader = function () {
};

QueryLoader2.prototype.onLoadComplete = function() {
//fire the event before end animation
this.options.onLoadComplete();

if (this.options.completeAnimation == "grow") {
var animationTime = this.options.minimumTime;

Expand Down

0 comments on commit 8e06bdc

Please sign in to comment.