spacer

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

home / experts / javascript / column30


Positioning A Scroll Box

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

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, 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/position