Replace .width( with .outerWidth( to support jQuery >= 1.8