Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions blazy.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
Blazy.prototype.revalidate = function() {
initialize();
};
Blazy.prototype.load = function(element){
if(!isElementLoaded(element)) loadImage(element);
Blazy.prototype.load = function(element, force){
if(!isElementLoaded(element)) loadImage(element, force);
};
Blazy.prototype.destroy = function(){
if(options.container){
Expand Down Expand Up @@ -125,9 +125,9 @@
}
}

function loadImage(ele){
function loadImage(ele, force){
// if element is visible
if(ele.offsetWidth > 0 && ele.offsetHeight > 0) {
if ((ele.offsetWidth > 0 && ele.offsetHeight > 0) || (force === true)) {
var dataSrc = ele.getAttribute(source) || ele.getAttribute(options.src); // fallback to default data-src
if(dataSrc) {
var dataSrcSplitted = dataSrc.split(options.separator);
Expand Down