469,306 Members | 2,512 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

Is it possible to set focus to a table cell?

Hi!

I have a scrollable css table cell thing going on, and would like to
set the initial page focus to that cell in order that scrolling up and
down with the cursor keys (or mouse scroll wheel even) will scroll that
table cell rather than the html page.

The page in question is here: http://test.jonathanmortimer.co.uk/other/

Any help is much appreciated! All I've managed to find so far is focus
on form fields, I don't even know if focus on table cells is possible
but I'd have thought it should be.

Jun 12 '06 #1
8 13200
jo************@yahoo.co.uk wrote:
Hi!

I have a scrollable css table cell thing going on, and would like to
set the initial page focus to that cell in order that scrolling up and
down with the cursor keys (or mouse scroll wheel even) will scroll that
table cell rather than the html page.

The page in question is here: http://test.jonathanmortimer.co.uk/other/

Any help is much appreciated! All I've managed to find so far is focus
on form fields, I don't even know if focus on table cells is possible
but I'd have thought it should be.


Hi,

Just an idea (without looking into your code):
You can maybe use a good old anchortag in your table at the right spot, and
go to there?

<a name="comehere"></a>

Now for JS, on some event:
location.hash = "comehere";

Regards,
Erwin Moller
Jun 12 '06 #2
You can maybe use a good old anchortag in your table at the right spot, and
go to there?

<a name="comehere"></a>

Now for JS, on some event:
location.hash = "comehere";


Thankyou! That certainly put me on the right track. I'd got as far as
the anchor tag but when it comes to onload and all that stuff I didn't
have a clue (I really should get a pocket reference book on it, any
recommendations? I really like the CSS Pocket Reference from O'Reilly
which I have for CSS stuff)

My complete solution was this:
In the <head> section:

<script type="text/javascript">
window.onload=function() {location.hash = "top"}
</script>
and further down, in my css-scrollable table cell:

<h2><a name="top">The Money Pit</a></h2>

Hurray! :D

Jun 13 '06 #3
Jonathan wrote:
You can maybe use a good old anchortag in your table at the right spot,
and go to there?

<a name="comehere"></a>

Now for JS, on some event:
location.hash = "comehere";
Thankyou!


Glad to be of help. :-)

That certainly put me on the right track. I'd got as far as the anchor tag but when it comes to onload and all that stuff I didn't
have a clue (I really should get a pocket reference book on it, any
recommendations? I really like the CSS Pocket Reference from O'Reilly
which I have for CSS stuff)
I would absolutely advise the fat book of O'Reilly, AKA the bible:
Javascript, The definite Guide 4th edition.

It is THE reference and also serves as a great learningbook.
Hence it's fatness. ;-)

My complete solution was this:
In the <head> section:

<script type="text/javascript">
window.onload=function() {location.hash = "top"}
</script>
and further down, in my css-scrollable table cell:

<h2><a name="top">The Money Pit</a></h2>

Hurray! :D


Good job.
:-)

Regards,
Erwin Moller
Jun 13 '06 #4
I would absolutely advise the fat book of O'Reilly, AKA the bible:
Javascript, The definite Guide 4th edition.


Hmm, I will look out for it but only if it's not too expensive :/

In the <head> section:

<script type="text/javascript">
window.onload=function() {location.hash = "top"}
</script>
and further down, in my css-scrollable table cell:

<h2><a name="top">The Money Pit</a></h2>


Ack! Just discovered this doesn't work in Firefox (or Safari). I
don't suppose you could suggest any tweaks I could try? I'm pretty
much lost with all this javascript stuff without a book.

Jun 13 '06 #5

Ack! Just discovered this doesn't work in Firefox (or Safari). I
don't suppose you could suggest any tweaks I could try? I'm pretty
much lost with all this javascript stuff without a book.


Correction: it *does* work in Firefox (1.5.0.2 on the Mac) but not
Safari, so I still need to sort this out - anyone know why it wouldn't
work in Safari? Can someone try this in IE on Windows for me too? :D

Jun 13 '06 #6
For pocket references, I use the Visibone pocket references at
www.visibone.com. Their are free online charts on the site.


Erwin Moller wrote:
Jonathan wrote:
You can maybe use a good old anchortag in your table at the right spot,
and go to there?

<a name="comehere"></a>

Now for JS, on some event:
location.hash = "comehere";


Thankyou!


Glad to be of help. :-)

That certainly put me on the right track. I'd got as far as
the anchor tag but when it comes to onload and all that stuff I didn't
have a clue (I really should get a pocket reference book on it, any
recommendations? I really like the CSS Pocket Reference from O'Reilly
which I have for CSS stuff)


I would absolutely advise the fat book of O'Reilly, AKA the bible:
Javascript, The definite Guide 4th edition.

It is THE reference and also serves as a great learningbook.
Hence it's fatness. ;-)

My complete solution was this:
In the <head> section:

<script type="text/javascript">
window.onload=function() {location.hash = "top"}
</script>
and further down, in my css-scrollable table cell:

<h2><a name="top">The Money Pit</a></h2>

Hurray! :D


Good job.
:-)

Regards,
Erwin Moller


Jun 14 '06 #7
JRS: In article <44***********************@news.xs4all.nl>, dated Tue,
13 Jun 2006 10:47:24 remote, seen in news:comp.lang.javascript, Erwin
Moller <si******************************************@spam yourself.com>
posted :

I would absolutely advise the fat book of O'Reilly, AKA the bible:
Javascript, The definite Guide 4th edition.

It is THE reference and also serves as a great learningbook.
Hence it's fatness. ;-)

Is that a recommendation given in the knowledge that the 5th Edition was
described as "soon" over a month ago?

For searchers : it's "javascript: The Definitive Guide".

<FAQENTRY> Sec 3.1 needs review.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jun 14 '06 #8
Dr John Stockton wrote:
JRS: In article <44***********************@news.xs4all.nl>, dated Tue,
13 Jun 2006 10:47:24 remote, seen in news:comp.lang.javascript, Erwin
Moller <si******************************************@spam yourself.com>
posted :

I would absolutely advise the fat book of O'Reilly, AKA the bible:
Javascript, The definite Guide 4th edition.

It is THE reference and also serves as a great learningbook.
Hence it's fatness. ;-)

Is that a recommendation given in the knowledge that the 5th Edition was
described as "soon" over a month ago?


Hi John,

No, my recommendations are always given without knowledge.
Knowledge is overrated. :P

But yes, I saw that 5th edition announced in this very group.

For searchers : it's "javascript: The Definitive Guide".
Hmm, definitive? LOL.
I must have misread that title for ages then.
And also the former editions.
Anyway, thanks for correcting.
(Goes off buying new glasses.)

Regards,
Erwin Moller


<FAQENTRY> Sec 3.1 needs review.


Jun 14 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Marian Aldenhövel | last post: by
2 posts views Thread by ted | last post: by
3 posts views Thread by harry | last post: by
2 posts views Thread by Bass Pro | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.