码迷,mamicode.com
首页 > Web开发 > 详细

jQuery工作碰到的

时间:2016-06-23 14:13:48      阅读:241      评论:0      收藏:0      [点我收藏+]

标签:

技术分享
<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>
View Code

 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>
View Code

 

jQuery工作碰到的

标签:

原文地址:http://www.cnblogs.com/tabCtrlShift/p/5610402.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!