spacer

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

home / experts / javascript / column30


Devising A Scrolling Algorithm

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

Our scrolling algorithm is very similar to the one we introduced in column 13, Scrolling JavaScript Banners. The trick we used in the previous column, we'll use again in this column: keep rotating the already-displayed sections out of the top of the page, to the bottom of the scrolling page. In the previous column, where we had hard-coded headlines, we kept duplicating the top message and concatenating it to the bottom message. In this column, though, the feed is coming from an external HTML file. The scrolling algorithm manipulates two identical layers that load the same HTML source file, thus creating the scrolling effect. The following diagram explains this algorithm. We have two pages, firstPage and secondPage. The pages are changing relative positions every cycle. During the first part of the cycle, the firstPage is in the upperPage position, while the secondPage is in the lowerPage position. They switch positions at the second part of the cycle: the secondPage is in the upperPage position, while the firstPage is in the lowerPage position. The canvas is the window through which the scrolling text is shown. Here is the diagram:




http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran


The Network for Technology Professionals

Search:

About Internet.com

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

webref The latest from WebReference.com Browse >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
IBM DB2 10 for z/OS: Justifying the Upgrade · Living La Vida Colo: Choosing the Right Colocation Facility · FTC Concerns over Social Media Privacy Linger


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

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