[Javascript] is their a javascript function, or DOMproperty to find the char limit of a table cell or div?

Lee Bettridge lbettridge at twowaytv.co.uk
Wed Jan 31 04:24:47 CST 2007


Paul,

You were correct in that "It sounds like Lee is visualizing a page-up,
page-down scenario in which the scrolling text moves up or down" and I
move the text about half the height of the div tag so the user does not
get lost.

You were also correct in that the TV Browser does not 'to my knowledge',
allow for font resizing or customizing, as text on a tv screen must be
more constrained to remain readable.

My problem is that the user can scroll down through the text and then
keep scrolling down for ever, as I have no way of knowing when the text
has finished, and no way of 'cutting' the text into pages so I can count
them.


-----Original Message-----
From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu] On Behalf Of Paul Novitski
Sent: 30 January 2007 19:53
To: javascript at LaTech.edu
Subject: RE: [Javascript] is their a javascript function, or DOMproperty
to find the char limit of a table cell or div?

At 1/30/2007 08:24 AM, Lee Bettridge wrote:
>Content-class: urn:content-classes:message
>Content-Type: multipart/alternative;
>         boundary="----_=_NextPart_001_01C7448B.28869C13"
>
>  I need to manually scroll a large body of text in a table cell or 
> div tag and was wondering if their is a way to find out how many 
> characters will fit into an area of a given size ?
>
>Normally in a browser environment any overflow would automatically 
>be handled by scroll bars (unless scroll bars are explicitly turned 
>off), but I am working in a TV browser and remote control 
>environment and cannot use scroll bars.

At 1/30/2007 10:20 AM, John Warner wrote:
>Wouldn't the font the user has selected for his browser (if he chose 
>to override page - say vision problems) impact this?


I wonder if this is a table of content scrolling in the browser 
window or a table cell with content that scrolls because the cell has 
been styled with {overflow: scroll} in CSS?

Yes, so he would need to look up the current font size, line height, 
margins, and padding as determined by inline styling + stylesheets + 
default styling to calculate the height of text blocks in the 
scrolling area.  Unless of course the TV browser allows for a fixed 
font-size (ick) or isn't capable of font resizing (double-ick), in 
which case everything may be known from the outset.

If the content consists of a series of page elements (table rows, 
paragraphs, divs) then javascript can step through them until it 
finds one that begins below the bottom of the window and thereby 
determine through trial and error how many rows fit in the window 
without having to calculate anything.

It sounds like Lee is visualizing a page-up, page-down scenario in 
which the scrolling text moves up or down one div-height.  An 
alternative might be to move it up or down one or more rows (or a 
percentage of window height) and let the user key repeatedly to shift 
up & down.  In my experience some people are confused by page-up & 
page-down: because the entire contents of the window changes there's 
no perceptible movement up or down.

Regards,

Paul
__________________________

Juniper Webcraft Ltd.
http://juniperwebcraft.com 

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript
-- 
Two Way TV is the trading name of Two Way Media Ltd
Company Number: 4904168



More information about the Javascript mailing list