-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d0c0a5
commit c2c2e06
Showing
3 changed files
with
13 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/*! waitForImages jQuery Plugin - v2.4.0 - 2018-02-13 | ||
* https://github.com/alexanderdickson/waitForImages | ||
* Copyright (c) 2018 Alex Dickson; Licensed MIT */ | ||
/*! waitForImages jQuery Plugin - v2.4.0 - 2018-02-17 | ||
* https://github.com/alexanderdickson/waitForImages | ||
* Copyright (c) 2018 Alex Dickson; Licensed MIT */ | ||
;(function (factory) { | ||
if (typeof define === 'function' && define.amd) { | ||
// AMD. Register as an anonymous module. | ||
|
@@ -18,7 +18,7 @@ | |
|
||
// Is srcset supported by this browser? | ||
var hasSrcset = (function(img) { | ||
return img.srcset && img.sizes; | ||
return img.srcset !== undefined && img.sizes !== undefined; | ||
This comment has been minimized.
Sorry, something went wrong. |
||
})(new Image()); | ||
|
||
// CSS properties which contain references to images. | ||
|
@@ -216,9 +216,9 @@ | |
|
||
}); | ||
|
||
if (hasSrcset && img.srcset) { | ||
image.srcset = img.srcset; | ||
image.sizes = img.sizes; | ||
if (hasSrcset && img.element.srcset) { | ||
image.srcset = img.element.srcset; | ||
image.sizes = img.element.sizes; | ||
This comment has been minimized.
Sorry, something went wrong.
Cardinal90
Author
|
||
} | ||
image.src = img.src; | ||
}); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If
srcset
is supported,img.srcset
andimg.sizes
return empty strings resulting in falsey value.