472,805 Members | 1,199 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

accessibility: possible to determine browser-chosen point size of a relative font-size?

All my font-sizes are set as relative sizes in CSS (large, medium, small,
x-small, etc). Let's say something is set in CSS to be xx-large, but a
visually impaired user wants it displayed even bigger. Can a script
determine an element's absolute size, *as it is being rendered by the
browser*, and then increment the element's font-size in absolute terms?
Thanks!
Timo


Jul 23 '05 #1
1 1662
Well, I have this script that makes a line span the screen size. You can
ofcourse always do something like document.body.style.fontSize='5cm';
This would make characters about 5 centimeters high.

<html>
<head>
<script language="JavaScript">
<!--

function calibrate() {
obj = document.getElementById('sizetest');
grow(0, obj.offsetHeight);
}
function grow(size, rowHeight) {
size+=10;
document.body.style.fontSize = size+'px';
window.setTimeout(
"growTest("+size+","+rowHeight+");",10);
}

function shrink(size, rowHeight) {
size-=1;
document.body.style.fontSize = size+'px';
window.setTimeout(
"shrinkTest("+size+","+rowHeight+");",10);
}

function shrinkTest(size, rowHeight) {
obj = document.getElementById('sizetest');
if (obj.offsetHeight>(rowHeight/2)) {
shrink(size, obj.offsetHeight);
}
}

function growTest(size, rowHeight) {
obj = document.getElementById('sizetest');
if (obj.offsetHeight>(rowHeight*2)) {
shrink(size, obj.offsetHeight);
} else {
grow(size, obj.offsetHeight);
}
}
<!-- -->
</script>

</head>
<body onLoad="calibrate();">

<SPAN id="sizetest">This should span a whole line</SPAN>

</body>
</html>
Timo wrote:
All my font-sizes are set as relative sizes in CSS (large, medium, small,
x-small, etc). Let's say something is set in CSS to be xx-large, but a
visually impaired user wants it displayed even bigger. Can a script
determine an element's absolute size, *as it is being rendered by the
browser*, and then increment the element's font-size in absolute terms?
Thanks!
Timo


Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: JAMESICUS | last post by:
Refer to ..... http://news.com.com/2100-1032-5063444.html James Pickering Pickering Pages http://www.jp29.org/
17
by: Harlan Messinger | last post by:
I am reviewing a set of pages, some of which include in-line mathematical formulas represented as images. I am addressing the accessibility issues behind those images. (Conformance to Section 508...
2
by: Jim Ley | last post by:
Hi People, The WAI (Web Accessibility Initiative) folk in the W3 are looking to get a good script techniques document, and are obviously looking for help. See Matt May: ...
4
by: mscir | last post by:
Is it possible to detect whether a protocol client-side on any given user's machine? Thanks, Mike
5
by: Dave Henson | last post by:
Hi I am checking a site for accessibility and Dreamweaver suggests making sure that the menu is accessible via keyboard as well as mouse (i.e device-independent). A question has arisen which is...
54
by: richard_quick_uk | last post by:
Hi, If anyone's got the time I'd really appreciate any feedback on the accessibility of this site: http://www.cata.co.uk/_index.asp
11
by: Simon Shutter | last post by:
Forgive me if I am posting to wrong newsgroup and for a couple of loaded questions. First, from what I understand, one of the advantages of XHTML/CSS is the ability of screen readers/braille...
3
by: Webmaster | last post by:
I'm working on a site that will have a typical CSS drop menu appear on all pages. The menu is based on this example: http://www.htmldog.com/articles/suckerfish/dropdowns/example/bones1.html Some...
3
by: Brian Cryer | last post by:
I posted this question recently to microsoft.public.dotnet.languages.vb but didn't get any answer. I'm hoping that someone here will be able to help me. I'm working on a project using VB.NET...
4
by: clintonG | last post by:
Web Development Accessibility About to Become Regulated By Law Read it (if you can) and weep because its very near becoming written into law now that this report has been finished...and not just...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.