Forum Moderators: open

Message Too Old, No Replies

Setting focus on div

get control of DIV

         

kadnan

9:21 am on Feb 18, 2006 (gmt 0)

10+ Year Member



Hello
I am keep comming with my problems.

if i have a DIV with scrollbar enabled,when i click on Div,dIV is focused then i can use arrow keys for scrolling up and down.

is there anyway to use my own function to:

1)focus the div
2)executing my own function on pressing Arrow keys as well as it scroll downs div?

thanks

Arno_Adams

1:15 pm on Feb 18, 2006 (gmt 0)

10+ Year Member



Hi kadnan,

Not sure what you mean, but I hope this helps:


<body onload="window.test.focus()">
<div id="test" style="height: 50px; overflow: auto;">
The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
</div>

HTH, AA

kadnan

8:00 pm on Feb 19, 2006 (gmt 0)

10+ Year Member



Thanks a lot,it saved me:)