Tutorial Get an Images Native Width
If you select and image with jQuery and then use .width(), you'll get the images current width, even if it's been scaled (e.g. max-w...
https://iskablogs.blogspot.com/2014/03/tutorial-get-images-native-width.html
If you select and image with jQuery and then use .width(), you'll get the images current width, even if it's been scaled (e.g. max-width: 100%;). You can access the images native width (even if it doesn't have any attributes which declare it) like this:
// Get on screen image
var screenImage = $("#image");
// Create new offscreen image to test
var theImage = new Image();
theImage.src =
// Get on screen image
var screenImage = $("#image");
// Create new offscreen image to test
var theImage = new Image();
theImage.src =