I tried with something like this:
var Height = $(this).naturalHeight;
But it doesn\'t work. Is there any way to do that
greez
One way to get the dimensions of an image is to dynamically load a copy of the image using javascript and obtain it's dimensions:
// preload the image
var height, width = '';
var img = new Image();
var imgSrc = '/path/to/image.jpg';
$(img).load(function () {
alert('height: ' + img.height);
alert('width: ' + img.width);
// garbage collect img
delete img;
}).error(function () {
// image couldnt be loaded
alert('An error occurred and your image could not be loaded. Please try again.');
}).attr({ src: imgSrc });