Posts Tagged ‘code’

JQuery Image Dimensions

Tuesday, June 30th, 2009

Simple code to grab the dimensions of any image on your page. Here’s an example:

My Image

Tell JQuery to find out how big this image is by using:

var width = $("#my_image").width();
var height = $("#my_image").height();