473,396 Members | 1,942 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,396 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 1680
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.a­sp
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.