02.06.2013 Views

DOM Traversal Methods

DOM Traversal Methods

DOM Traversal Methods

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

.offset()<br />

Gets the top and left coordinates of the first element in the set of matched<br />

elements. Also gets the matched element's scrollTop and scrollLeft offsets.<br />

.offset([options])<br />

.offset(options, returnObject)<br />

Parameters (First Version)<br />

•<br />

options (optional): A map of settings to configure the way the offset is<br />

calculated. Can contain the following items:<br />

°<br />

°<br />

°<br />

°<br />

°<br />

margin (optional): A Boolean indicating whether to include<br />

the element's margin in the calculations. Default is true.<br />

border (optional): A Boolean indicating whether to include<br />

the element's border in the calculations. Default is false.<br />

padding (optional): A Boolean indicating whether to include<br />

the element's padding in the calculations. Default is false.<br />

scroll (optional): A Boolean indicating whether to include<br />

the scroll offsets of all ancestor elements in the calculations.<br />

Default is true.<br />

lite (optional): A Boolean indicating whether to use<br />

offsetLite instead of offset. Default is false.<br />

[ 207 ]<br />

Chapter 10

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!