Re: Best Practices For Clicking To Expand Text

A relatively simple way to do this, is to use ARIA Toggle controls, via role=button and aria-pressed="true" or "false" depending on what the active state is. When activated, it toggles a class to show or hide as expected. If using an active element, a click handler should be added for this, and return false should be used to prevent page refresh, or if using a natively non-active element, then both a click and keypress should be added to ensure keyboard accessibility, as well as tabindex=0, and proper color contrast for the active region and focus rectangle.

This is how the TSG document works at
http://whatsock.com/tsg
If you would like an example to test with ATs. It just uses the ARIA Toggle module.
 
  ----- Original Message ----- 
  From: Homme, James 
  To: w3c-wai-ig@w3.org 
  Sent: Monday, May 06, 2013 8:01 AM
  Subject: Best Practices For Clicking To Expand Text


  Hi,

  The goal is to present a simple document with pieces of expandable text or pieces of text that the reader can show or hide. I was thinking of making a simple JavaScript function that can swap CSS classes that would show or hide text on the ID of the element I feed it. When you click the piece of text before the text in question, it either shows the text, if the css for that element has the hide class, or hides the piece of text if it has the show class. Is this a good or bad thing to try? If not, what is a good way to do something like this that is relatively simple to implement?



  Thanks.



  Jim





------------------------------------------------------------------------------

  This e-mail and any attachments to it are confidential and are intended solely for use of the individual or entity to whom they are addressed. If you have received this e-mail in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not keep, use, disclose, copy or distribute this e-mail without the author's prior permission. The views expressed in this e-mail message do not necessarily represent the views of Highmark Inc., its subsidiaries, or affiliates.

Received on Monday, 6 May 2013 16:28:16 UTC