15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

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.

260<br />

<strong>JavaScript</strong> <strong>Examples</strong> <strong>Bible</strong>: The Essential Companion to <strong>JavaScript</strong> <strong>Bible</strong><br />

rightMargin<br />

See bottomMargin.<br />

scroll<br />

NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5<br />

Compatibility ✓ ✓ ✓<br />

Example<br />

To change the scrollbar appearance from the default, the statement is:<br />

document.body.scroll = “no”<br />

scrollLeft<br />

scrollTop<br />

document.body.scrollLeft<br />

NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5<br />

Compatibility ✓ ✓ ✓<br />

Example<br />

Listing 18-20 is the IE4+ version of the NN example for pageXOffset and<br />

pageYOffset properties (Listing 16-13 in Chapter 2). Everything about these two<br />

examples is the same except for the syntax that retrieves the values indicating how<br />

much the document is scrolled in a window.<br />

Listing 18-20: Viewing the scrollLeft and scrollTop Properties<br />

<br />

<br />

Master of all Windows<br />

<br />

function leftFrame() {<br />

var output = “Body Scroll Values\n”<br />

output += “body.scrollLeft:\n”<br />

output += “body.scrollTop:\n”<br />

output += “”<br />

return output<br />

}

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

Saved successfully!

Ooh no, something went wrong!