spacer

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

home / experts / javascript / column32


Setting Up the Pages

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

The pages are prepared inside the showAndScroll() and makeSecondPage() functions. The showAndScroll() function creates the first page in Netscape Navigator, by calling fillFirstPage() function, which is explained earlier. The rest of the showAndScroll() function sets the firstPages's left, top, and visibility properties:

function showAndScroll() {
  if (NS4) fillFirstPage();
  if (NS4) {
    firstPage.left = GleftPadding;
    firstPage.top = 0;
  }
  else {
    firstPage.style.pixelLeft = GleftPadding;
    firstPage.style.pixelTop = 0;
  }
  eval("firstPage" + styleString).visibility = (NS4) ? "show" : "visible";
  upperPage = firstPage;
  firstPage.onmouseover = stopScrolling;
  firstPage.onmouseout = scrollPages;
  if (NS4) {firstPage.onload = makeSecondPage;}
  else {makeSecondPage();};
}

Notice the inconsistency between the browsers regarding the call to the makeSecondPage() function. Netscape Navigator requires the first page to load before the second one can be attempted.

The makeSecondPage() function sets up the second page by filling it in Netscape Navigator and then assigning its visibility:

function makeSecondPage() {
  if (NS4) fillSecondPage();
  secondPage.onmouseover = stopScrolling;
  secondPage.onmouseout = scrollPages;
  lowerPage = secondPage;
  eval("secondPage" + styleString).visibility = (NS4) ? "show" : "visible";
  if (NS4) {secondPage.onLoad = launchScroller;}
  else {launchScroller();}
}

As before, the scroller cannot be launched before the second page is loaded. The actual launching of the scroller is triggered by setting the top coordinate of the second page and then calling the scrollPages() function for moving up the page:

function launchScroller() {
  if (NS4) {secondPage.top = secondPage.clip.height;}
  else {secondPage.style.pixelTop = secondPage.clientHeight;};
  scrollPages();
}

http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

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

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


Created: December 21, 1998
Revised: December 21, 1998

URL: http://www.webreference.com/js/column32/pages.html