Solved

scrollTo() and scrollby()

Posted on 1997-06-26
4
291 Views
Last Modified: 2010-05-18
window.moveTo and window.resizeTo() work fine in Netscape 4.0, but I can't get subject functions to work.  Please send working example.

Thanks
Dale Means
0
Comment
Question by:dmeans
  • 2
  • 2
4 Comments
 

Expert Comment

by:ryanmc
ID: 1267781
scrollTo jumps the window directly to a location from where ever you are.
scrollBy scrolls the window a certain amount. For example,

If your at X: 25, Y: 50
scrollTo(100,100) would take you to X:100, Y:100
scrollBy(100,100) would take you to X:125, Y:150.

Here's an example of scrollTo. The syntax for scrollBy is the same.

<HTML><HEAD><TITLE>ScrollTo Example</TITLE></HEAD>
<BODY>
<A HREF="javascript:scrollTo(0,1000)">Scroll Down</A>
<BR>q<BR>w<BR>e<BR>r<BR>t<BR>y
<BR>u<BR>i<BR>o<BR>p<BR>a<BR>s
<BR>d<BR>h<BR>j<BR>k<BR>l<BR>z
<BR>x<BR>c<BR>v<BR>b<BR>n<BR>m
<BR>q<BR>w<BR>e<BR>r<BR>t<BR>y
<BR>u<BR>i<BR>o<BR>p<BR>a<BR>s
<BR>d<BR>f<BR>g<BR>h<BR>j<BR>k
<BR>l<BR>z<BR>x<BR>c<BR>v<BR>b
<BR>n<BR>m<BR>q<BR>w<BR>e<BR>r
<BR>t<BR>y<BR>q<BR>w<BR>e<BR>r
<BR>t<BR>y<BR>u<BR>i<BR>o<BR>p
<BR>a<BR>s<BR>d<BR>h<BR>j<BR>k
<BR>l<BR>z<BR>x<BR>c<BR>v<BR>b
<BR>n<BR>m<BR>q<BR>w<BR>e<BR>r
<BR>t<BR>y<BR>u<BR>i<BR>o<BR>p
<BR>a<BR>s<BR>d<BR>f<BR>g<BR>h
<BR>j<BR>k<BR>l<BR>z<BR>x<BR>c
<BR>v<BR>b<BR>n<BR>m<BR>q<BR>w
<BR>e<BR>r<BR>t<BR>y<BR>q<BR>w
<BR>e<BR>r<BR>t<BR>y<BR>u<BR>i
<BR>o<BR>p<BR>a<BR>s<BR>d<BR>h
<BR>j<BR>k<BR>l<BR>z<BR>x<BR>c
<BR>v<BR>b<BR>n<BR>m<BR>q<BR>w
<BR>e<BR>r<BR>t<BR>y<BR>u<BR>i
<BR>o<BR>p<BR>a<BR>s<BR>d<BR>f
<BR>g<BR>h<BR>j<BR>k<BR>l<BR>z
<BR>x<BR>c<BR>v<BR>b<BR>n<BR>m
<BR>q<BR>w<BR>e<BR>r<BR>t<BR>y
</BODY>
</HTML>
0
 

Author Comment

by:dmeans
ID: 1267782
I know the window will scroll vertically (Y) but I wented an example of how to scroll horizonally (X).  All the examples I have found use 0 for X, as above.  I would very much appreciate an example which will scroll "across" instead of just "up and down".

Many thanks.

Dale means

0
 

Accepted Solution

by:
ryanmc earned 50 total points
ID: 1267783
Well, then. The only time that you would need to scroll to the side is when you have a large image. So write a page like this:
If you have a big picture, use it. Otherwise go into paint and make a new picture, something like 2000x2000 or something. Then scribble all over the picture so u can tell when it moves.

<HTML>
<BODY>
<A href="javascript:scrollBy(500,0)">Scroll Right</A>
<IMG SRC="bigimage (a picture bigger than your browser window)">
</BODY>
</HTML>
0
 

Author Comment

by:dmeans
ID: 1267784
It works fine.

Thanks
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question