{"id":907,"date":"2016-09-14T22:48:56","date_gmt":"2016-09-15T05:48:56","guid":{"rendered":"http:\/\/blogs.lanecc.edu\/webteam\/?p=907"},"modified":"2016-09-14T22:48:56","modified_gmt":"2016-09-15T05:48:56","slug":"click-to-expand","status":"publish","type":"post","link":"https:\/\/blogs.lanecc.edu\/webteam\/2016\/09\/14\/click-to-expand\/","title":{"rendered":"Click to Expand"},"content":{"rendered":"<p>A few days ago, an astute employee over in Enrollment Services pointed out that our <a href=\"https:\/\/www.lanecc.edu\/counseling\/steps-enroll-ftic\">steps to enroll pages<\/a> weren&#8217;t completely accessible to the blind. This is an important problem, and a surprisingly tricky one.<\/p>\n<p>The current legal requirements for web accessibility (including \u00a71194.22, which we&#8217;re most interested in) are referred to as <a href=\"https:\/\/www.access-board.gov\/guidelines-and-standards\/communications-and-it\/about-the-section-508-standards\/guide-to-the-section-508-standards\/web-based-intranet-and-internet-information-and-applications-1194-22\">Section 508<\/a>. These standards provide some useful guidance on how to help folks with an impairment of some kind. For instance, they describe how images should have an alt text field, except for when that image doesn&#8217;t support understanding of the content (e.g. a background or filler image).<\/p>\n<p>On the other hand, these standards are now old enough to vote, meaning they&#8217;re older than Facebook, Twitter, selfie sticks, Google Chrome, iPhones, the Columbus Blue Jackets, and Windows XP. Needless to say, they&#8217;re showing their age.<\/p>\n<p>There&#8217;s no way to make click to expand text accessible under current 508 guidelines. Our best option would be to duplicate the page and provide a text only version. Unfortunately, that could lead to a screenreader having to read a lot of unnecessary text.<\/p>\n<p>The solution relies in the <a href=\"https:\/\/www.access-board.gov\/guidelines-and-standards\/communications-and-it\/about-the-ict-refresh\">proposed new standards<\/a>. These are still in progress, but the web community is confident they&#8217;re going to heavily include something called <a href=\"https:\/\/www.w3.org\/WAI\/intro\/aria\">WAI-ARIA<\/a>. WAI-ARIA provides a way to mark up your pages with extra attributes that screen readers know how to recognize, so the blind can better use interactive pages.<\/p>\n<p>Returning to our original problem, starting this evening we&#8217;re now using the <a href=\"http:\/\/a11y.nicolas-hoffmann.net\/hide-show\/\">hide-show accessible plugin<\/a> on those pages. This plugin lets you write some fairly simple markup in your page which will then get converted to a click to expand box like on the steps to enroll.<\/p>\n<p>To use, you&#8217;ll first want to click the blue link below the edit box in Drupal that says &#8220;disable rich text&#8221;. Then, if you want a simple button with some text below it, you&#8217;ll want to paste this in:<code><\/code><\/p>\n<pre><code> &lt;p class=\"js-expandmore\"&gt;Click on me&lt;\/p&gt;\r\n &lt;div class=\"js-to_expand\"&gt;\r\n     here is the hidden content!\r\n &lt;\/div&gt;<\/code><\/pre>\n<p>Then replace &#8220;Click on me&#8221; and &#8220;to show me!&#8221; with whatever works for your page. You&#8217;ll get something like this:<\/p>\n<p><a href=\"https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.27.52-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-908\" src=\"https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.27.52-PM.png\" alt=\"plus sign with some latin text that'd normally be clickable\" width=\"520\" height=\"160\" srcset=\"https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.27.52-PM.png 520w, https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.27.52-PM-300x92.png 300w, https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.27.52-PM-500x154.png 500w\" sizes=\"auto, (max-width: 520px) 85vw, 520px\" \/><\/a><\/p>\n<p>And when you click to expand, you&#8217;ll see this:<\/p>\n<p><a href=\"https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.28.02-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-909\" src=\"https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.28.02-PM.png\" alt=\"minus sign, with the same text as before, but now with more text shown below it\" width=\"388\" height=\"228\" srcset=\"https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.28.02-PM.png 388w, https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.28.02-PM-300x176.png 300w\" sizes=\"auto, (max-width: 388px) 85vw, 388px\" \/><\/a><\/p>\n<p>If you&#8217;d like a little bit of color, you can also use an <code>h3<\/code> element, which would place that text in an orange box:<\/p>\n<pre>\u00a0\u00a0\u00a0 &lt;h2 class=\"js-expandmore\"&gt;Lorem dolor si amet&lt;\/h2&gt;\r\n\u00a0\u00a0\u00a0 &lt;div class=\"js-to_expand\"&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 here is the hidden content\r\n\u00a0\u00a0\u00a0 &lt;\/div&gt;<\/pre>\n<p>Exactly the same as before, but now it&#8217;ll look like this:<\/p>\n<p><a href=\"https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.30.48-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-910\" src=\"https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.30.48-PM.png\" alt=\"same plus with text, but now with an orange background\" width=\"604\" height=\"184\" srcset=\"https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.30.48-PM.png 604w, https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.30.48-PM-300x91.png 300w, https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.30.48-PM-500x152.png 500w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a><\/p>\n<p>This is actually the more correct use &#8211; you nearly always want to use an <code>h<\/code> element of some kind when it describes the text after it.<\/p>\n<p>For really advanced use, you can also add a full class to make the button full width. Or you can add the blue class to make the orange background blue instead. Or both!<\/p>\n<pre>\u00a0\u00a0\u00a0 &lt;h3 class=\"js-expandmore blue full\"&gt;Lorem dolor si amet&lt;\/h2&gt;\r\n\u00a0\u00a0\u00a0 &lt;div class=\"js-to_expand\"&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 here is the hidden content\r\n\u00a0\u00a0\u00a0 &lt;\/div&gt;<\/pre>\n<p>would look like this:<\/p>\n<p><a href=\"https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.34.04-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-911\" src=\"https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.34.04-PM.png\" alt=\"blue background, full width, with same plus and text\" width=\"1196\" height=\"170\" srcset=\"https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.34.04-PM.png 1196w, https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.34.04-PM-300x43.png 300w, https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.34.04-PM-768x109.png 768w, https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.34.04-PM-1024x146.png 1024w, https:\/\/blogs.lanecc.edu\/webteam\/wp-content\/uploads\/sites\/25\/2016\/09\/Screen-Shot-2016-09-14-at-10.34.04-PM-500x71.png 500w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<p>This is definitely getting into advanced content editing in Drupal, so if you&#8217;re stuck don&#8217;t hesitate to contact us at webmaster@lanecc.edu.<\/p>\n<p>Remember, we should always try to use the right tool. For instance, these kinds of show and hide buttons might seem like they&#8217;d be perfect for an FAQ. But we already have a different setup for FAQ questions, that takes care of alphabetizing and tracking changes to each question. And remember that many of the visitors to your page won&#8217;t bother clicking the button at all. Always spend time simplifying your content to make sure the important message is apparent even without clicking to show your other text.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few days ago, an astute employee over in Enrollment Services pointed out that our steps to enroll pages weren&#8217;t completely accessible to the blind. This is an important problem, and a surprisingly tricky one. The current legal requirements for web accessibility (including \u00a71194.22, which we&#8217;re most interested in) are referred to as Section 508. &hellip; <a href=\"https:\/\/blogs.lanecc.edu\/webteam\/2016\/09\/14\/click-to-expand\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Click to Expand&#8221;<\/span><\/a><\/p>\n","protected":false},"author":86,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":"","_wpscppro_dont_share_socialmedia":false,"_wpscppro_custom_social_share_image":0,"_facebook_share_type":"","_twitter_share_type":"","_linkedin_share_type":"","_pinterest_share_type":"","_linkedin_share_type_page":"","_instagram_share_type":"","_medium_share_type":"","_threads_share_type":"","_google_business_share_type":"","_selected_social_profile":[],"_wpsp_enable_custom_social_template":false,"_wpsp_social_scheduling":{"enabled":false,"datetime":null,"platforms":[],"status":"template_only","dateOption":"today","timeOption":"now","customDays":"","customHours":"","customDate":"","customTime":"","schedulingType":"absolute"},"_wpsp_active_default_template":true},"categories":[3],"tags":[6,25],"class_list":["post-907","post","type-post","status-publish","format-standard","hentry","category-drupal","tag-accessibility","tag-drupal"],"_links":{"self":[{"href":"https:\/\/blogs.lanecc.edu\/webteam\/wp-json\/wp\/v2\/posts\/907","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.lanecc.edu\/webteam\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.lanecc.edu\/webteam\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.lanecc.edu\/webteam\/wp-json\/wp\/v2\/users\/86"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.lanecc.edu\/webteam\/wp-json\/wp\/v2\/comments?post=907"}],"version-history":[{"count":2,"href":"https:\/\/blogs.lanecc.edu\/webteam\/wp-json\/wp\/v2\/posts\/907\/revisions"}],"predecessor-version":[{"id":913,"href":"https:\/\/blogs.lanecc.edu\/webteam\/wp-json\/wp\/v2\/posts\/907\/revisions\/913"}],"wp:attachment":[{"href":"https:\/\/blogs.lanecc.edu\/webteam\/wp-json\/wp\/v2\/media?parent=907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.lanecc.edu\/webteam\/wp-json\/wp\/v2\/categories?post=907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.lanecc.edu\/webteam\/wp-json\/wp\/v2\/tags?post=907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}