473,395 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 13600
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marian Aldenhövel | last post by:
Hi, Short question: Is it possible to write a CSS-Style that formats <INPUT TYPE=TEXT>-Elements in Table-Cells in a way that they use all the horizontal space available? Long question: I...
2
by: Sugapablo | last post by:
Can anyone help me out with some code to change three table cells (<td>) when one is hovered over? I have a calendar grid where each day is made up of three table cells and I want all three to...
2
by: ted | last post by:
Hi, Was wondering if it's possible to find the left position of a table cell if the cell is created dynamically. I have a table with a single cell. When a button is clicked, I'd like to add...
3
by: harry | last post by:
I want to be able to change the text alignment within a table cell between "right" & "center" depending on how many rows are in the table. Is this possible in Javascript? - can't see how to do...
2
by: Bass Pro | last post by:
How do I access a textbox when it was added to a table cell? I've tried using the findcontrol function with no result. I create it as such... Dim myTable As Table = New Table Dim Row as...
7
by: SteveM | last post by:
I am sure this is an easy question, but being relatively new to ASP.NET programming, I can not quite grasp what I need to accomplish what I need to do. What I have is a word document that is...
2
by: Jukka K. Korpela | last post by:
Sub titulo "Re: DIV borders different in IE7 when in td" scripsit Ben C: This seems to be the heart of the matter, and I'm trying to get a real discussion started, by moving the discussion to...
4
by: foolmelon | last post by:
Before AJAX, we were able to focus a cell in a gridview during a fullpage postback. After putting the gridview inside an UpdatePanel, we cannot focus a cell in this gridview anymore. Does anybody...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.