Scrolling in document using JS ???

M

Martin Mrazek

Hi,
can I manipulate with scroll bars by JS in HTML? Something like

------------------
frame1
button1: ToLeft
button2: ToRight
------------------
frame2

....long and wide like a hell :)


------------------

clicking on ToLeft button user remains on the same vertical position,
but horizontally is scrolled to left margin.

Of course, this is not the real task I'm solving, it would be
ridiculous to avoid scroll bars in such a case. I just don't want to
bother with lenthy description of the real problem, but extract the
substance...

Martin
 
M

Martin Honnen

Martin said:
Hi,
can I manipulate with scroll bars by JS in HTML? Something like

There are frame/window methods scrollTo and scrollBy so
if (parent.frames.frame2Name) {
parent.frames.frame2Name.scrollBy(20, 0);
}
should scroll horizontally by 20 pixels.
 
F

Fokke Nauta

There are frame/window methods scrollTo and scrollBy so
if (parent.frames.frame2Name) {
parent.frames.frame2Name.scrollBy(20, 0);
}
should scroll horizontally by 20 pixels.


Thanks, Martin
This is exactly the script I needed as well.

"I have a simple frame set (frame.htm) with a header and a main page. The
header (header.htm) contains 2 buttons: scroll-up and scroll-down. The main
page (main.htm) contains text only. When I click on the scroll-up button in
the header, I want the main page to scroll up 13 lines. The same for
scrolling down.
Is there a javascript that can make another page scrolling?
"

Best regards,

Fokke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top