标签:
<a aria-expanded="true" id="TLink1" href="#" onclick="toggle(‘navbar‘, ‘TLink1‘)">Toggle Navigation Bar 1</a> <ul style="" id="navbar"> <li><a href="http://example.com/target1.html">Link 1</a></li> <li><a href="http://example.com/target2.html">Link 2</a></li> <li><a href="http://example.com/target3.html">Link 3</a></li> <li><a href="http://example.com/target4.html">Link 4</a></li> </ul> <style type="text/css" media="screen"> #navbar li, #navbar2 li { display: inline; list-style-type: none; padding-right: 20px; } </style> <script type="text/javascript"> function toggle(id, id2) { var n = document.getElementById(id); if (n.style.display != ‘none‘) { n.style.display = ‘none‘; document.getElementById(id2).setAttribute(‘aria-expanded‘, ‘false‘); } else { n.style.display = ‘‘; document.getElementById(id2).setAttribute(‘aria-expanded‘, ‘true‘); } } </script>
https://www.w3.org/WAI/GL/wiki/Using_aria-expanded_to_indicate_the_state_of_a_collapsible_element
<li class="light-blue"> <a class="dropdown-toggle" href="#" data-toggle="dropdown" aria-expanded="false"> <!-- <img class="nav-user-photo" src="assets/avatars/user.jpg" alt="Jason‘s Photo" /> --> <span class="user-info"> <small>上午好,</small> 中徽管理员 </span> <i class="ace-icon fa fa-caret-down"></i> </a> <ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close"> <li> <a href="/platform/change_password"> <i class="ace-icon fa fa-user"></i> 修改密码 </a> </li> <li class="divider"></li> <li> <a href="/logout"> <i class="ace-icon fa fa-power-off"></i> 退出 </a> </li> </ul> </li>
标签:
原文地址:http://www.cnblogs.com/tabCtrlShift/p/5610402.html