Scrolling in document using JS ???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martin Mrazek

    #1

    Scrolling in document using JS ???

    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
  • Martin Honnen

    #2
    Re: Scrolling in document using JS ???



    Martin Mrazek wrote:
    [color=blue]
    > 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 :-)
    >[/color]

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

    --

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

    Comment

    • Fokke Nauta

      #3
      Re: Scrolling in document using JS ???

      "Martin Honnen" <mahotrash@yaho o.de> wrote in message
      news:40b60e30$1 @olaf.komtel.ne t...

      <cut>
      [color=blue]
      > There are frame/window methods scrollTo and scrollBy so
      > if (parent.frames. frame2Name) {
      > parent.frames.f rame2Name.scrol lBy(20, 0);
      > }
      > should scroll horizontally by 20 pixels.
      >
      > --
      >
      > Martin Honnen
      > http://JavaScript.FAQTs.com/[/color]


      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


      Comment

      Working...