使用SammyJS为单页应用程序设置锚链接颜色

时间:2014-05-17 11:31:48

标签: anchor single-page-application sammy.js

我的SammyJS应用程序中有以下导航结构。

<div id="sidebar-left" class="col-lg-2 col-sm-1">

                <input type="text" id="txt-search-items" class="search hidden-sm" placeholder="Search..." />

                <div class="nav-collapse sidebar-nav collapse navbar-collapse bs-navbar-collapse">
                    <ul class="nav nav-tabs nav-stacked main-menu">
                        <li class="parent">
                            <a href="#/link1"><i class="fa fa-dashboard"></i><span class="hidden-sm">Link 1</span></a>
                        </li>
                        <li class="parent">
                            <a class="dropmenu" href="#link2"><i class="fa fa-list-ul"></i><span class="hidden-sm">Link 2</span></a>
                            <ul class="child">
                                <li><a class="submenu" href="#/link2/sublink"><i class="fa fa-eye"></i><span class="hidden-sm">Sub Link</span></a></li>
                                </ul>
                        </li>
                        <li class="parent">
                            <a class="dropmenu" href="#link3"><i class="fa fa-archive"></i><span class="hidden-sm">Link 3</span></a>
                            <ul class="child">
                                <li><a class="submenu" href="#/link3/sublink1"><i class="fa fa-eye"></i><span class="hidden-sm">Sublink 1</span></a></li>
                                <li><a class="submenu" href="#/link3/sublink2"><i class="fa fa-eye"></i><span class="hidden-sm">Sublink 2</span></a></li>
                            </ul>
                        </li>
                        <li class="parent">
                            <a class="dropmenu" href="#/link4"><i class="fa fa-user"></i><span class="hidden-sm">Link 4</span></a>
                            <ul class="child">
                                <li><a class="submenu" href="#/link4/sublink1"><i class="fa fa-eye"></i><span class="hidden-sm">Sublink 1</span></a></li>
                                <li><a class="submenu" href="#/link4/sublink2"><i class="fa fa-eye"></i><span class="hidden-sm">Sublink 2</span></a></li>
                                <li><a class="submenu" href="#/link4/sublink3"><i class="fa fa-eye"></i><span class="hidden-sm">Sublink 3</span></a></li>
                            </ul>
                        </li>
                        <li class="parent">
                            <a class="dropmenu" href="#/administration"><i class="fa fa-cogs"></i><span class="hidden-sm">Link 5</span></a>
                            <ul class="child">
                                <li><a class="submenu" href="#/link5/sublink1"><i class="fa fa-eye"></i><span class="hidden-sm">Sublink 1</span></a></li>
                                <li><a class="submenu" href="#/link5/sublink2"><i class="fa fa-eye"></i><span class="hidden-sm">Sublink 2</span></a></li>
                                <li><a class="submenu" href="#/link5/sublink3"><i class="fa fa-eye"></i><span class="hidden-sm">Sublink 3</span></a></li>
                                <li><a class="submenu" href="#/link5/sublink4"><i class="fa fa-eye"></i><span class="hidden-sm">Sublink 4</span></a></li>
                                <li><a class="submenu" href="#/link5/sublink5"><i class="fa fa-eye"></i><span class="hidden-sm">Sublink 5</span></a></li>
                                <li><a class="submenu" href="#/link5/sublink6"><i class="fa fa-eye"></i><span class="hidden-sm">Sublink 6</span></a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>

我正在尝试在有效点击时设置锚链接背景颜色,但由于:a的使用,这似乎与#无关。有什么想法吗?

0 个答案:

没有答案