If you want to get dimensions including margins and borders try using JQuery functions outerWidth
and outerHeight
. They should take care about crossbrowser differences. http://api.jquery.com/outerwidth/
If you want to get only dimensions of an element contents (without margins, borders, paddings) use width
and height
. http://api.jquery.com/width/