|
 |
asp_web_howto thread: Move a focused input text box to the top of the screen
Message #1 by Wei Wang <wxw20@p...> on Tue, 09 Jul 2002 12:11:05 -0400
|
|
There is a list of numbers on the left side frame and a list of text boxes
for input on the right side frame. When I click on the number on the left
frame, the input text box of the same number on the right side frame will
be selected (focused). My problem is when I move from a small number to a
large number, the selected text box on the right appears on the bottom of
the screen. I'd like it to be on the top of the screen.
Please help me to solve the problem.
Message #2 by "phil griffiths" <pgtips@m...> on Wed, 10 Jul 2002 15:54:05
|
|
IE4+ has the scrollIntoView method which is supported for input/text boxes.
JS syntax would be:
objText.scrollIntoView(true);
where objText is a reference to the text box.
I dont know of any NS equivalent.
HTH
Phil
-------------------------------------
> There is a list of numbers on the left side frame and a list of text
>boxes
>for input on the right side frame. When I click on the number on the left
>frame, the input text box of the same number on the right side frame will
>be selected (focused). My problem is when I move from a small number to a
>large number, the selected text box on the right appears on the bottom of
>the screen. I'd like it to be on the top of the screen.
>Please help me to solve the problem.
Message #3 by "Joerk Oosterlaande" <mastahj@h...> on Mon, 22 Jul 2002 14:39:40
|
|
In NS4+ you could use something like this JS:
window.scrollTo(objText.x,objText.y);
this will scroll the document horizontally as well... if this is not
wanted objText.x is replaced by 0 or window.pageXOffset
Hope this helps... I'm don't think the x and y thing works in N6. I
haven't tried it though... Guess you'll have to do that and get back if it
doesn't work.
In N6 I guess you could try:
document.getElementBYId(objText).style.top;
But I'm not quite shure... It's possible that it eill return 0 (zero) if
it's a static object and the property is not set.
Good luck!
/ Joerk
> There is a list of numbers on the left side frame and a list of text
boxes
for input on the right side frame. When I click on the number on the left
frame, the input text box of the same number on the right side frame will
be selected (focused). My problem is when I move from a small number to a
large number, the selected text box on the right appears on the bottom of
the screen. I'd like it to be on the top of the screen.
Please help me to solve the problem.
|
|
 |