15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}<br />

}<br />

clearInterval(intervalID)<br />

Chapter 2 ✦ Window and Frame Objects (Chapter 16)<br />

function reduceInterval() {<br />

stopScroll()<br />

scrollSpeed -= 200<br />

startScroll()<br />

}<br />

function increaseInterval() {<br />

stopScroll()<br />

scrollSpeed += 200<br />

startScroll()<br />

}<br />

function reduceJump() {<br />

scrollJump -= 2<br />

}<br />

function increaseJump() {<br />

scrollJump += 2<br />

}<br />

function swapDirection() {<br />

scrollDirection = (scrollDirection == “down”) ? “up” : “down”<br />

}<br />

function startScroll() {<br />

parent.display.scrollBy(0, scrollJump)<br />

if (intervalID) {<br />

clearInterval(intervalID)<br />

}<br />

intervalID = setInterval(“autoScroll()”,scrollSpeed)<br />

}<br />

function stopScroll() {<br />

clearInterval(intervalID)<br />

}<br />

<br />

<br />

<br />

AutoScroll by setInterval() Controller<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

175<br />

windowObject.setInterval()

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

Saved successfully!

Ooh no, something went wrong!