Hello compliance pros!
I've been tasked with making our web-app compliant to the section 508 and wcag 2.0 guidlines. For most things this hasn't been too tricky, but i've hit a bit of a road block.
I use qtip a lot in the app, which tends to be mostly compliant b/c it uses the wai-aria role and described-by attributes. BUT, the way i add my tooltips makes it so they don't get put on the text until the first mouseover. which clearly isn't going to happen with keyboard navigation, and i'm not sure how screen readers wil handle that either!
I've made a fiddle here: http://jsfiddle.net/patriciavandermeer/xkhy6/2/ that demonstrates what i'm talking about. the tooltips are html that the end users can set elsewhere, and they list items may or may not have a tooltip.
i was thinking about making the tooltips be applied and show up on :focus(and hide on loss of focus), but then i'd need to give the span a tabindex and i'm not sure how well supported that is, can all the main browsers handle that ok?
or should i just bite the bullet and have the tooltips hooked up in the document ready? I had some serious performance issues on some of my busier pages when i had it set up that way.
EDIT: Here's a sample of the html that would be used, and the jquery/ javascript i use to attach the tooltips to the spans.
Sample HTML:
<li >
<span class="InteractiveToolTipMe">Administration</span>
<div class="InteractiveToolTip NoDisplay"><p>This is a description</p>
<p> </p>
<p>For administration.....</p></div>
</li>
<li >
Board and Committees
</li>
<li >
Community Outreach
</li>
<li >
<span class="InteractiveToolTipMe">Fundraising</span>
<div class="InteractiveToolTip NoDisplay"><p><strong>test</strong></p>
<p> </p>
<ul>
<li><strong>test</strong></li>
<li>test</li>
<li>test</li>
</ul>
</div>
</li>
<li style="padding:2px;">
Physics
</li>
<li style="padding:2px;">
Public Speaking
</li>
<li style="padding:2px;">
Special Events
</li>
</ul>
Javascript for attaching the tooltips:
$('span.InteractiveToolTipMe').live("mouseover", function () {
var $this = $(this);
if (!$this.data("toolTipAttached")) {
var content = $(this).parent().find('.InteractiveToolTip').html();
$this.qtip({
content: {
text: content
},
position: {
target: 'mouse',
adjust: {
mouse: false
},
viewport: $(window)
},
hide: {
fixed: true,
delay:350,
when: 'mouseout'
},
show: {
solo: true,
delay: 350,
ready: true
},
style: {
widget: true,
tip:false,
classes: "LegendTip"
}
});
$this.data("toolTipAttached", true);
//$this.trigger("mouseover");
}
});