【发布时间】:2014-10-22 15:46:27
【问题描述】:
我有兴趣使用 tooltipster 制作可访问的工具提示。问题是我的工具提示的内容不是 html 格式的。几乎没问题,除了不支持 html 标签(p 和 img)的工具提示内容。函数 .html() 应该可以完成这项工作,不是吗?
HTML
<a href="#" id="my_id" class="picto-tooltip" aria-describedby="my_id_description"></a>
<div id="my_id_description" role="tooltip">
<p>This the title for the tooltip</p>
<img src="/images/myimage.jpg" alt="Alternative text for the image" />
</div>
JS
$('#my_id').tooltipster({ 函数初始化:函数(){ 返回 $('#my_id_description').html(); }, 函数就绪:函数(){ $('#my_id_description').attr('aria-hidden', false); }, 函数之后:函数(){ $('#my_id_description').attr('aria-hidden', true); } });感谢您的帮助。
【问题讨论】:
-
是的,它以这种方式工作,但我必须以另一种方式来实现它的键盘可访问性。该方法位于链接的同一页面上,位于底部。本节称为“使残障人士可以使用工具提示”。
标签: jquery jquery-tooltip