spacer

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

home / experts / javascript / column30


Positioning A Scroll Box

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

There are many ways to position a scroll box. You can position it in absolute coordinates, but the desired location may change because of an ad put at the top of the page, for example. In this column we use the table method. We place a dummy GIF at the top left and the bottom right corners of the table. We fill the table with some example headlines that will span the desired height of the scroll box. Here is the table in our page:

<TABLE ALIGN=RIGHT WIDTH=275>
<TR>
<TD ALIGN=LEFT><IMG NAME="pht" SRC="t.gif" ALT="" WIDTH=1 HEIGHT=1></TD>
</TR>
<TD>
<img class="bullet" src="bullet.gif">
<A CLASS="headline" HREF="/js/column29/"><B>[29] DOCJSLIB Version 3.0: Page
Watermarks</B></A>
<p>

<img class="bullet" src="bullet.gif">
<A CLASS="headline" HREF="/js/column28/"><B>[28] DOCJSLIB Version 2.0</B></A>
<p>

<img class="bullet" src="bullet.gif">
<A CLASS="headline" HREF="/js/column27/"><B>[27] DOCJSLIB Library, Part
I</B></A>
<p>

<img class="bullet" src="bullet.gif">
<A CLASS="headline" HREF="/js/column26/"><B>[26] JavaScript 1.3 Review,
Part II</B></A>
<p>

<img class="bullet" src="bullet.gif">
<A CLASS="headline" HREF="/js/column25/"><B>[25] JavaScript 1.3 Review,
Part I</B></A>
<p>

<img class="bullet" src="bullet.gif">
<A CLASS="headline" HREF="/js/column24/"><B>[24] Internet Explorer 5.0
Review, Part III</B></A>
<p>

</TD>
</TR>
<TR><TD ALIGN=RIGHT><IMG NAME="phb" SRC="t.gif" ALT="" WIDTH=1
HEIGHT=1></TD></TR>

</TABLE>

We then compute the coordinates of these GIFs in our scrolling box code:

bnrLft=document.images.pht.x;
bnrTop=document.images.pht.y;
bnrRit=document.images.phb.x;
bnrBot=document.images.phb.y;
bnrWid=bnrRit-bnrLft;
bnrHit=bnrBot-bnrTop;

and we use these coordinates to call the scroll box API:

scrollBox(bnrLft, bnrTop, bnrWid, bnrHit,'jscolumns3.html',50)

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: November 23, 1998
Revised: November 23, 1998

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