Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #19930 > unrolled thread
| Started by | justaguy <lichunshen84@gmail.com> |
|---|---|
| First post | 2013-05-24 11:26 -0700 |
| Last post | 2013-05-24 15:20 -0400 |
| Articles | 5 — 4 participants |
Back to article view | Back to comp.lang.javascript
How to manage cursor? justaguy <lichunshen84@gmail.com> - 2013-05-24 11:26 -0700
Re: How to manage cursor? Danny <dann90038@gmail.com> - 2013-05-24 12:00 -0700
Re: How to manage cursor? justaguy <lichunshen84@gmail.com> - 2013-05-24 14:34 -0700
Re: How to manage cursor? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-25 07:37 +0200
Re: How to manage cursor? Dr.Kral@nyc.rr.com - 2013-05-24 15:20 -0400
| From | justaguy <lichunshen84@gmail.com> |
|---|---|
| Date | 2013-05-24 11:26 -0700 |
| Subject | How to manage cursor? |
| Message-ID | <3d37a9e7-b930-4e64-adf9-42e07c4e52ef@googlegroups.com> |
Hi,
I have two DIVs, one in the left and the other right.
More info:
*
left DIV (id of 'leftD') is empty by default, right DIV (id of 'rightD') has lots of contents.
*
when a user scrolls down for the right DIV, and find one piece of content interesting something, say, content 8 (id of 'content8'), click on it (clickAction) and brings it to the top of the left DIV ('leftD'). No problem, so far so good.
Issue:
However, the cursor does not go with the above action, that is, the screen remains the same (still at the bottom of the right DIV). What could I do to make the cursor to move to the top of the left DIV?
My attempt of adding the following statement,
document.getElementById('leftD').focus();
prior to clickAction
OR
after
has no effects.
How to do it?
Many thanks.
[toc] | [next] | [standalone]
| From | Danny <dann90038@gmail.com> |
|---|---|
| Date | 2013-05-24 12:00 -0700 |
| Message-ID | <4a3c79b1-1694-4981-b2c1-c22a959b9936@googlegroups.com> |
| In reply to | #19930 |
to justaguy
document.getElementById('leftD').scrollInToView()
[toc] | [prev] | [next] | [standalone]
| From | justaguy <lichunshen84@gmail.com> |
|---|---|
| Date | 2013-05-24 14:34 -0700 |
| Message-ID | <b7a8f73b-8101-47ad-9b4d-9c474eb92015@googlegroups.com> |
| In reply to | #19932 |
On Friday, May 24, 2013 3:00:16 PM UTC-4, Danny wrote:
> to justaguy
>
>
>
> document.getElementById('leftD').scrollInToView()
Danny, beautiful, thanks, and you're a great typist :)
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2013-05-25 07:37 +0200 |
| Message-ID | <2755443.SJZZS1iBPl@PointedEars.de> |
| In reply to | #19943 |
justaguy wrote:
> On Friday, May 24, 2013 3:00:16 PM UTC-4, Danny wrote:
>> to justaguy
>>
>>
>>
>> document.getElementById('leftD').scrollInToView()
>
> Danny, beautiful, thanks, and you're a great typist :)
Which proves that a great typist can be a lousy programmer.
--
PointedEars
Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | Dr.Kral@nyc.rr.com |
|---|---|
| Date | 2013-05-24 15:20 -0400 |
| Message-ID | <89fvp81ksou1sagahdaa7jb5gcvpria3en@4ax.com> |
| In reply to | #19930 |
On Fri, 24 May 2013 11:26:43 -0700 (PDT), justaguy <lichunshen84@gmail.com>
wrote in <3d37a9e7-b930-4e64-adf9-42e07c4e52ef@googlegroups.com>:
>However, the cursor does not go with the above action, that is, the screen remains the same (still at the bottom of the right DIV). What could I do to make the cursor to move to the top of the left DIV?
>My attempt of adding the following statement,
>document.getElementById('leftD').focus();
>prior to clickAction
>OR
>after
>has no effects.
You described:
document.getElementById('leftD').focus();
function clickAction(){code}
OR
function clickAction(){code}
document.getElementById('leftD').focus();
will not get the focus statement executed.
You need:
onclick="clickAction();document.getElementById('leftD').focus();"
OR
function clickAction(){code ;
document.getElementById('leftD').focus(); }
HTH
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web