Skip to content

Commit

Permalink
jQuery Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dernerd committed Jun 22, 2024
1 parent 8636d38 commit e5d82af
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions ui/lightslider/js/lightslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,20 +448,27 @@
});
};
setCss();
if (obj.has('img')) {
obj.find('img').load(function () {
setTimeout(function () {
setCss();
if (!interval) {
$this.auto();
}
}, 100);
if (obj.has('img').length) {
obj.find('img').each(function() {
this.addEventListener('load', function() {
setTimeout(function() {
setCss();
if (!interval) {
$this.auto();
}
}, 100);
});

// Fallback für Browser, die das load-Event auf img nicht richtig unterstützen
if (this.complete) {
this.dispatchEvent(new Event('load'));
}
});
}else{
} else {
if (!interval) {
$this.auto();
}
}
}
},
active: function (ob, t) {
if (this.doCss() && settings.mode === 'fade') {
Expand Down

0 comments on commit e5d82af

Please sign in to comment.