ALEX L wrote:
>
> Hi there,
> this might not be a servlet problem but is anybody out there knows how
> to make scrolling text within a html page?
> i want to know how of which the text to scroll on the page is from a
> .txt file.
> is it possible to retrieve values from that .txt file and scroll it
> across the screen.
> if anyone can supply me with some codes, i will be appreciated.
> codes either in html(if possible), java or javascript. any one which
> is best for my case and simple.
> thanks a lot for ur time.
>
> regards,
> alex

I'm not sure if I understand your question, but I think
you can find one of the possible answers in the JAVASCRIPT REFERENCE
However I don't think what you want will be easy to write.

First of all: is will not work on every browser

Second remark: how are you going to calculate the coordinate
of a specific line in your txt-file. Couldn't you use a HTML
file with some <A NAME=""></A>-tags in it?

scroll
Scrolls a window to a specified coordinate.
Method of Window
Implemented in Navigator 3.0; deprecated in 4.0
Description
In Navigator 4.0, scroll is no longer used and has been replaced by
scrollTo. scrollTo extends the capabilities of scroll. scroll remains
for backward compatibility.

scrollBy
Scrolls the viewing area of a window by the specified amount.
Method of Window
Implemented in Navigator 4.0
Syntax
scrollBy(horizontal, vertical)
Parameters
   horizontal The number of pixels by which to scroll the viewing area
horizontally.
   vertical The number of pixels by which to scroll the viewing area
vertically.
Description
This method scrolls the content in the window if portions that can't be
seen exist outside of the window. scrollBy scrolls the window by adding
or subtracting the specified number of pixels to the current scrolled
location.  For this method to have an effect the visible property of
Window.scrollbars must be true.
Examples
To scroll the current window 5 pixels towards the left and 30 pixels
down from the current position, use this statement:
self.scrollBy(-5,30); // relative positioning
See also Window.scrollTo

scrollTo
Scrolls the viewing area of the window so that the specified point
becomes the top-left corner.
Method of Window
Implemented in Navigator 4.0
Syntax
scrollTo(x-coordinate, y-coordinate)
Parameters
   x-coordinate An integer representing the x-coordinate of the viewing
area in pixels.
   y-coordinate An integer representing the y-coordinate of the viewing
area in pixels.
Description
scrollTo replaces scroll. scroll remains for backward compatibility.
The scrollTo method scrolls the content in the window if portions that
can't be seen exist outside of the window. For this method to have an
effect the visible property of Window.scrollbars must be true.
Examples
Example 1: Scroll the current viewing area. To scroll the current window
to the leftmost boundary and 20 pixels down from the top of the window,
use this statement:
self.scrollTo(0,20); // absolute positioning
Example 2: Scroll a different viewing area. The following code, which
exists in one frame, scrolls the viewing area of a second frame. Two
Text objects let the user specify the x and y coordinates. When the user
clicks the Go button, the document in frame2 scrolls to the specified
coordinates.
<SCRIPT>
function scrollIt(form) {
   var x = parseInt(form.x.value)
   var y = parseInt(form.y.value)
   parent.frame2.scrollTo(x, y)
}
</SCRIPT>
<BODY>
<FORM NAME="myForm">
<P><B>Specify the coordinates to scroll to:</B>
<BR>Horizontal:
<INPUT TYPE="text" NAME=x VALUE="0" SIZE=4>
<BR>Vertical:
<INPUT TYPE="text" NAME=y VALUE="0" SIZE=4>
<BR><INPUT TYPE="button" VALUE="Go"
   onClick="scrollIt(document.myForm)">
</FORM>
See also Window.scrollBy
--
-------------------------------------------------------------------
Bruno Lowagie           Academisch Rekencentrum Universiteit Gent
Tel : 09/264.48.14      e-mail : [EMAIL PROTECTED]
-------------------------------------------------------------------

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to