From 15199049ad4aa653b1c8a71a2ea215fe5a65a6b7 Mon Sep 17 00:00:00 2001 From: jieyou Date: Tue, 28 Feb 2017 16:56:00 +0800 Subject: [PATCH] fix #15 --- .gitattributes | 0 .gitignore | 0 README.textile | 0 examples/css/appelsiini.css | 0 examples/css/font-awesome.min.css | 0 examples/css/jieyou.css | 0 examples/disabled.html | 0 examples/enabled.html | 0 examples/enabled_ajax.html | 0 examples/enabled_amd.html | 0 examples/enabled_background.html | 0 examples/enabled_container.html | 0 examples/enabled_fadein.html | 0 examples/enabled_gazillion.html | 0 examples/enabled_image_full_width.html | 0 examples/enabled_no_fake_img_loader.html | 0 examples/enabled_noscript.html | 0 examples/enabled_srcset.html | 0 examples/enabled_timeout.html | 0 examples/enabled_url_rewriter_fn.html | 0 examples/enabled_vertical_only.html | 0 examples/enabled_wide.html | 0 examples/enabled_wide_container.html | 0 examples/font/fontawesome-webfont.woff | Bin examples/img/bmw_m1_hood.jpg | Bin examples/img/bmw_m1_hood_rewritten.jpg | Bin examples/img/bmw_m1_side.jpg | Bin examples/img/bmw_m3_gt.jpg | Bin examples/img/corvette_pitstop.jpg | Bin examples/img/grey.gif | Bin examples/img/transparent.gif | Bin examples/img/viper_1.jpg | Bin examples/img/viper_corner.jpg | Bin examples/img/white.gif | Bin examples/page_js/html5shiv.js | 0 examples/remove_invisible.html | 0 lazyload.js | 7 ++++--- lazyload.min.js | 0 38 files changed, 4 insertions(+), 3 deletions(-) mode change 100644 => 100755 .gitattributes mode change 100644 => 100755 .gitignore mode change 100644 => 100755 README.textile mode change 100644 => 100755 examples/css/appelsiini.css mode change 100644 => 100755 examples/css/font-awesome.min.css mode change 100644 => 100755 examples/css/jieyou.css mode change 100644 => 100755 examples/disabled.html mode change 100644 => 100755 examples/enabled.html mode change 100644 => 100755 examples/enabled_ajax.html mode change 100644 => 100755 examples/enabled_amd.html mode change 100644 => 100755 examples/enabled_background.html mode change 100644 => 100755 examples/enabled_container.html mode change 100644 => 100755 examples/enabled_fadein.html mode change 100644 => 100755 examples/enabled_gazillion.html mode change 100644 => 100755 examples/enabled_image_full_width.html mode change 100644 => 100755 examples/enabled_no_fake_img_loader.html mode change 100644 => 100755 examples/enabled_noscript.html mode change 100644 => 100755 examples/enabled_srcset.html mode change 100644 => 100755 examples/enabled_timeout.html mode change 100644 => 100755 examples/enabled_url_rewriter_fn.html mode change 100644 => 100755 examples/enabled_vertical_only.html mode change 100644 => 100755 examples/enabled_wide.html mode change 100644 => 100755 examples/enabled_wide_container.html mode change 100644 => 100755 examples/font/fontawesome-webfont.woff mode change 100644 => 100755 examples/img/bmw_m1_hood.jpg mode change 100644 => 100755 examples/img/bmw_m1_hood_rewritten.jpg mode change 100644 => 100755 examples/img/bmw_m1_side.jpg mode change 100644 => 100755 examples/img/bmw_m3_gt.jpg mode change 100644 => 100755 examples/img/corvette_pitstop.jpg mode change 100644 => 100755 examples/img/grey.gif mode change 100644 => 100755 examples/img/transparent.gif mode change 100644 => 100755 examples/img/viper_1.jpg mode change 100644 => 100755 examples/img/viper_corner.jpg mode change 100644 => 100755 examples/img/white.gif mode change 100644 => 100755 examples/page_js/html5shiv.js mode change 100644 => 100755 examples/remove_invisible.html mode change 100644 => 100755 lazyload.js mode change 100644 => 100755 lazyload.min.js diff --git a/.gitattributes b/.gitattributes old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/README.textile b/README.textile old mode 100644 new mode 100755 diff --git a/examples/css/appelsiini.css b/examples/css/appelsiini.css old mode 100644 new mode 100755 diff --git a/examples/css/font-awesome.min.css b/examples/css/font-awesome.min.css old mode 100644 new mode 100755 diff --git a/examples/css/jieyou.css b/examples/css/jieyou.css old mode 100644 new mode 100755 diff --git a/examples/disabled.html b/examples/disabled.html old mode 100644 new mode 100755 diff --git a/examples/enabled.html b/examples/enabled.html old mode 100644 new mode 100755 diff --git a/examples/enabled_ajax.html b/examples/enabled_ajax.html old mode 100644 new mode 100755 diff --git a/examples/enabled_amd.html b/examples/enabled_amd.html old mode 100644 new mode 100755 diff --git a/examples/enabled_background.html b/examples/enabled_background.html old mode 100644 new mode 100755 diff --git a/examples/enabled_container.html b/examples/enabled_container.html old mode 100644 new mode 100755 diff --git a/examples/enabled_fadein.html b/examples/enabled_fadein.html old mode 100644 new mode 100755 diff --git a/examples/enabled_gazillion.html b/examples/enabled_gazillion.html old mode 100644 new mode 100755 diff --git a/examples/enabled_image_full_width.html b/examples/enabled_image_full_width.html old mode 100644 new mode 100755 diff --git a/examples/enabled_no_fake_img_loader.html b/examples/enabled_no_fake_img_loader.html old mode 100644 new mode 100755 diff --git a/examples/enabled_noscript.html b/examples/enabled_noscript.html old mode 100644 new mode 100755 diff --git a/examples/enabled_srcset.html b/examples/enabled_srcset.html old mode 100644 new mode 100755 diff --git a/examples/enabled_timeout.html b/examples/enabled_timeout.html old mode 100644 new mode 100755 diff --git a/examples/enabled_url_rewriter_fn.html b/examples/enabled_url_rewriter_fn.html old mode 100644 new mode 100755 diff --git a/examples/enabled_vertical_only.html b/examples/enabled_vertical_only.html old mode 100644 new mode 100755 diff --git a/examples/enabled_wide.html b/examples/enabled_wide.html old mode 100644 new mode 100755 diff --git a/examples/enabled_wide_container.html b/examples/enabled_wide_container.html old mode 100644 new mode 100755 diff --git a/examples/font/fontawesome-webfont.woff b/examples/font/fontawesome-webfont.woff old mode 100644 new mode 100755 diff --git a/examples/img/bmw_m1_hood.jpg b/examples/img/bmw_m1_hood.jpg old mode 100644 new mode 100755 diff --git a/examples/img/bmw_m1_hood_rewritten.jpg b/examples/img/bmw_m1_hood_rewritten.jpg old mode 100644 new mode 100755 diff --git a/examples/img/bmw_m1_side.jpg b/examples/img/bmw_m1_side.jpg old mode 100644 new mode 100755 diff --git a/examples/img/bmw_m3_gt.jpg b/examples/img/bmw_m3_gt.jpg old mode 100644 new mode 100755 diff --git a/examples/img/corvette_pitstop.jpg b/examples/img/corvette_pitstop.jpg old mode 100644 new mode 100755 diff --git a/examples/img/grey.gif b/examples/img/grey.gif old mode 100644 new mode 100755 diff --git a/examples/img/transparent.gif b/examples/img/transparent.gif old mode 100644 new mode 100755 diff --git a/examples/img/viper_1.jpg b/examples/img/viper_1.jpg old mode 100644 new mode 100755 diff --git a/examples/img/viper_corner.jpg b/examples/img/viper_corner.jpg old mode 100644 new mode 100755 diff --git a/examples/img/white.gif b/examples/img/white.gif old mode 100644 new mode 100755 diff --git a/examples/page_js/html5shiv.js b/examples/page_js/html5shiv.js old mode 100644 new mode 100755 diff --git a/examples/remove_invisible.html b/examples/remove_invisible.html old mode 100644 new mode 100755 diff --git a/lazyload.js b/lazyload.js old mode 100644 new mode 100755 index ac19c2e..063e9a4 --- a/lazyload.js +++ b/lazyload.js @@ -176,10 +176,11 @@ } $.each(defaultOptions,function(k,v){ + var typeK = type(options[k]) if($.inArray(k,['threshold','failure_limit','check_appear_throttle_time']) != -1){ // these params can be a string - if(type(options[k]) == 'String'){ + if(typeK == 'String'){ options[k] = parseInt(options[k],10) - }else{ + }else if(typeK != 'Number'){ options[k] = v } }else if(k == 'container'){ // options.container can be a seletor string \ dom \ jQuery object @@ -193,7 +194,7 @@ options._$container = $window } delete options.container - }else if(defaultOptions.hasOwnProperty(k) && (!options.hasOwnProperty(k) || (type(options[k]) != type(defaultOptions[k])))){ + }else if(defaultOptions.hasOwnProperty(k) && (!options.hasOwnProperty(k) || (typeK != type(defaultOptions[k])))){ options[k] = v } }) diff --git a/lazyload.min.js b/lazyload.min.js old mode 100644 new mode 100755