MediaWiki:Common.js: Difference between revisions

No edit summary
No edit summary
Line 243: Line 243:


             var ratio = $img.naturalWidth / $img.naturalHeight;
             var ratio = $img.naturalWidth / $img.naturalHeight;
             $elem.children[i].style.width = (ratio / totalRatio) * (totalWidth - 6 * lineMax) + 6 + 'px';
             var width = (ratio / totalRatio) * (totalWidth - 6 * lineMax) + 6;
            $elem.children[i].style.width = (width / totalWidth) * 100 + '%';
         }
         }
     }
     }
}
}