aboutsummaryrefslogtreecommitdiffstats
path: root/97suifangqa/staticfiles/javascripts/jquery.waitforimages.min.js
diff options
context:
space:
mode:
Diffstat (limited to '97suifangqa/staticfiles/javascripts/jquery.waitforimages.min.js')
-rw-r--r--97suifangqa/staticfiles/javascripts/jquery.waitforimages.min.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/97suifangqa/staticfiles/javascripts/jquery.waitforimages.min.js b/97suifangqa/staticfiles/javascripts/jquery.waitforimages.min.js
new file mode 100644
index 0000000..ffe60e7
--- /dev/null
+++ b/97suifangqa/staticfiles/javascripts/jquery.waitforimages.min.js
@@ -0,0 +1,4 @@
+/*! waitForImages jQuery Plugin - v1.4.2 - 2013-01-19
+* https://github.com/alexanderdickson/waitForImages
+* Copyright (c) 2013 Alex Dickson; Licensed MIT */
+(function(e){var t="waitForImages";e.waitForImages={hasImageProperties:["backgroundImage","listStyleImage","borderImage","borderCornerImage"]},e.expr[":"].uncached=function(t){if(!e(t).is('img[src!=""]'))return!1;var n=new Image;return n.src=t.src,!n.complete},e.fn.waitForImages=function(n,r,i){var s=0,o=0;e.isPlainObject(arguments[0])&&(i=arguments[0].waitForAll,r=arguments[0].each,n=arguments[0].finished),n=n||e.noop,r=r||e.noop,i=!!i;if(!e.isFunction(n)||!e.isFunction(r))throw new TypeError("An invalid callback was supplied.");return this.each(function(){var u=e(this),a=[],f=e.waitForImages.hasImageProperties||[],l=/url\(\s*(['"]?)(.*?)\1\s*\)/g;i?u.find("*").andSelf().each(function(){var t=e(this);t.is("img:uncached")&&a.push({src:t.attr("src"),element:t[0]}),e.each(f,function(e,n){var r=t.css(n),i;if(!r)return!0;while(i=l.exec(r))a.push({src:i[2],element:t[0]})})}):u.find("img:uncached").each(function(){a.push({src:this.src,element:this})}),s=a.length,o=0,s===0&&n.call(u[0]),e.each(a,function(i,a){var f=new Image;e(f).bind("load."+t+" error."+t,function(e){o++,r.call(a.element,o,s,e.type=="load");if(o==s)return n.call(u[0]),!1}),f.src=a.src})})}})(jQuery); \ No newline at end of file