473,804 Members | 3,085 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1699
Well, I have this script that makes a line span the screen size. You can
ofcourse always do something like document.body.s tyle.fontSize=' 5cm';
This would make characters about 5 centimeters high.

<html>
<head>
<script language="JavaS cript">
<!--

function calibrate() {
obj = document.getEle mentById('sizet est');
grow(0, obj.offsetHeigh t);
}
function grow(size, rowHeight) {
size+=10;
document.body.s tyle.fontSize = size+'px';
window.setTimeo ut(
"growTest("+siz e+","+rowHeight +");",10);
}

function shrink(size, rowHeight) {
size-=1;
document.body.s tyle.fontSize = size+'px';
window.setTimeo ut(
"shrinkTest("+s ize+","+rowHeig ht+");",10);
}

function shrinkTest(size , rowHeight) {
obj = document.getEle mentById('sizet est');
if (obj.offsetHeig ht>(rowHeight/2)) {
shrink(size, obj.offsetHeigh t);
}
}

function growTest(size, rowHeight) {
obj = document.getEle mentById('sizet est');
if (obj.offsetHeig ht>(rowHeight*2 )) {
shrink(size, obj.offsetHeigh t);
} else {
grow(size, obj.offsetHeigh t);
}
}
<!-- -->
</script>

</head>
<body onLoad="calibra te();">

<SPAN id="sizetest">T his 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
2189
by: JAMESICUS | last post by:
Refer to ..... http://news.com.com/2100-1032-5063444.html James Pickering Pickering Pages http://www.jp29.org/
17
2207
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 of the applicable US government regulations is required.) Ick--at least, I suppose, until MathML is generally supported. One approach would be to set the ALT attribute to be a linearized version of the equation. But this gets to be tough if...
2
1183
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: http://www.bestkungfu.com/archive/?id=496 now I don't know Matt really, I managed to miss talking to him at a meeting we were both at last week, but generally the W3 and WAI folk
4
2954
by: mscir | last post by:
Is it possible to detect whether a protocol client-side on any given user's machine? Thanks, Mike
5
2701
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 probably more to do with my lack of understanding of how a user might interact with a web site without using a mouse. I have tried using the onKeyDown command but it does not seem to be key-specific. If this command is added to eight menu...
54
4372
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
1971
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 agents to provide an improved experience than HTML with table layout. Notwithstanding the leadership of Chevrolet, Amnesty International and others, at what point do you think XHTML/CSS will become the preferred approach? Will it be when the number...
3
2395
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 of the pages will contain a Flash Player 7 object placed just below the menu where the "Lorem ipsum dolor..." text is on the above example. The problem is the CSS navigation then falls behind the actual Flash content which is very user...
3
1565
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 where the customer is very fussy about accessibility. One of the requirements that I'm trying to meet is that tables should have a summary, for example (and I've taken this from...
4
995
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 for federal websites. Section 508 Report http://www.access-board.gov/sec508/refresh/report/
0
9704
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10558
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10302
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5503
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2975
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.