spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column30


Stopping the Pages

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

To pause the scroll while a user mouses over the scrolling box, we added two events to the scrolling layers, onMouseOver and onMouseOut. These events are defined for both firstPage and secondPage layers, as either one of them may be exposed at the canvas container layer. The onMouseOver event occurs when the mouse is placed over the scroll box. The onMouseOut event occurs when the mouse is removed from the scroll box area. The event handler for the onMouseOver event is the scrollPages() function which has been discussed on the previous page. It starts the pages going, just as the invocation of the program would in the first place:

function scrollPages() {
  Gtimer = setInterval(slidePages,Gspeed);
}

The Gtimer variable stores a pointer to the setInterval() command, which invokes the slidePages() function every Gspeed ms. The event handler of the onMouseOut event is the stopScrolling() function which clears the Gtimer pointer and thus cancels the call to the slidePages() function, causing the pages to halt:

function stopScrolling() {
  clearInterval(Gtimer);
}

http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business


Created: November 23, 1998
Revised: November 23, 1998

URL: http://www.webreference.com/js/column30/stop