jQuery(function($) { var image= new Image(), width, height; image.src= 'http://www.tenman.info/wp3/manualraindrops/files/tower.jpg'; var image_width= 300; image.onload= function() { var height= image_width * this.height / this.width ; $('#theDiv').prepend(image).css({'width':image_width, height:height,'display':'inline-block'}) } });
結果は個別投稿ページで
javascript - jQuery: how to get the dimensions of a external image? - Stack Overflow