By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,528 Members | 1,305 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,528 IT Pros & Developers. It's quick & easy.

Scrolling in document using JS ???

P: n/a
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
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a


Martin Mrazek wrote:
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 :-)


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.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #2

P: n/a
"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:40********@olaf.komtel.net...

<cut>
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.

--

Martin Honnen
http://JavaScript.FAQTs.com/

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
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.