17

Plug-ins

Dimesions Plug-in

This is the outer dimensions box. It has the following CSS rule:

.dim-outer {
  height: 200px;
  width: 200px;
  margin: 10px;
  padding: 1em;
  border: 5px solid #e3e3e3;
  overflow: auto;
  font-size: 12px;
}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

This is the inner dimensions box.

Window & Document Dimensions

$(window).height(), $('element').width()

Trigger

$(document).height(), $(document).width()

Trigger

Element Dimensions

$('element').height(), $('element').width()

Trigger

$('element').innerHeight(), $('element').innerWidth()

Trigger

$('element').outerHeight(), $('element').outerWidth()

Trigger

scrollTop and scrollLeft

$('div.dim-outer').scrollTop(), $('div.dim-outer').scrollLeft()

Trigger

$(document).scrollTop(), $(document).scrollLeft()

Trigger

Offset

$('div.dim-outer').offset()

Trigger

$('div.dim-inner').offset()

Trigger