I have these images that I am getting off my server and a database using PHP
I would try .innerWidth()
instead of .width()
, as .width()
would include the margin.
$('img').innerWidth();
If your image is really that big, you should consider scaling it down it server-side.
Actually .width()
is not adding the margin and furthermore its not even adding the padding. That makes .width()
more suitable than .innerWidth()
. Thanks SKS.