gosora/themes/tempra_simple/public/misc.js

13 lines
395 B
JavaScript
Raw Permalink Normal View History

(() => {
addInitHook("end_init", () => {
// TODO: Run this when the image is loaded rather than when the document is ready?
$(".topic_list img").each(function(){
let aspectRatio = this.naturalHeight / this.naturalWidth;
log("aspectRatio",aspectRatio);
log("height",this.naturalHeight);
log("width",this.naturalWidth);
$(this).css({ height: aspectRatio * this.width });
});
});
2020-03-09 21:41:17 +00:00
})()