Skip to content
Permalink
Browse files
tweak total scroll width calculation.
  • Loading branch information
plainheart authored and Ovilia committed Jul 11, 2020
1 parent f0bc1eb commit 4ddf5ed637be7923b9e764ec3235012b5e09bd61
Showing 1 changed file with 3 additions and 3 deletions.
@@ -57,12 +57,12 @@
var companyImages = $('.companies img');
var loadedCompanyImages = companyImages.filter('.loaded');
companyLoaded = loadedCompanyImages.length === companyImages.length;
for (var i = 1, len = loadedCompanyImages.length; i < len; ++i) {
companyTotalWidth += loadedCompanyImages[i].width;
for (var i = 0, len = loadedCompanyImages.length; i < len; ++i) {
companyTotalWidth += loadedCompanyImages[i].width + 30;
}
}
companyLeft += 1;
if (companyLeft > companyTotalWidth) {
if (companyLeft > companyTotalWidth - $('.companies').width()) {
companyLeft = 0;
}
$('.companies').scrollLeft(companyLeft);

0 comments on commit 4ddf5ed

Please sign in to comment.