导航(滑块)活动状态

时间:2015-09-15 20:39:04

标签: javascript jquery css navigation slider

我想建立一个带有forWard和backwoard按钮的导航。例如,如果我点击forword或者更确切地说,在backworad上菜单点向前移动一个(如图像滑块)。

但应该允许直接点击每个按钮。按钮应该悬停在橙色,处于活动状态也是橙色。

这是一个例子: enter image description here

这是我的导航(html):

<nav>
<ul>
    <li id="icon-back">
        <a href="#" class="icon">
            <i class="fa fa-backward fa-3x"></i>
        </a>
    </li>
    <li>
        <a href="Home" class="icon">
            <i class="fa fa-home fa-3x"></i>
        </a>
    </li>
    <li>
        <a href="Info" class="icon">
            <i class="fa fa-video-camera fa-3x"></i>
        </a>
    </li>
    <li>
        <a href="Projects" class="icon">
            <i class="fa fa-code fa-3x"></i>
        </a>
    </li>
    <li>
        <a href="Contact" class="icon">
            <i class="fa fa-comments-o fa-3x"></i>
        </a>
    </li>
    <li id="icon-for">
        <a href="#" class="icon">
            <i class="fa fa-forward fa-3x"></i>
        </a>
    </li>
</ul>
</nav>

和我的CSS:

/******************************************* 
        Links
*******************************************/

a:link {
    text-decoration: none;
}

a:link:before {
    font-family:'Iceland';
    font-style: normal;
    font-size: 50px;
    font-weight: 700;
    color: #666;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
}

a:visited {
    color: #666;
}

a:hover {
    color: #F90;
}

a:active {
    color: #F90;
}

/******************************************* 
            Navigation    
*******************************************/

    nav {
    width: 100%;
    bottom: 0;
    left:0;
    height: 80px;
    position: fixed;
    background-color: #333;
    clear: both;
    background: -webkit-linear-gradient(white, #333 8%); /* For Safari 5.1 to 6.0 */
    background: -o-linear-gradient(white, #333 8%); /* For Opera 11.1 to 12.0 */
    background: -moz-linear-gradient(white, #333 ´8%); /* For Firefox 3.6 to 15 */
    background: linear-gradient(white, #333 8%); /* Standard syntax */
}

ul {
    list-style: none;
    text-align: center;
    height: 100%;
    margin-top: 20px;
}

li {
    display: inline;
    margin-right: 40px;
}

#icon-back {
    margin-right: 100px;   
}

#icon-for {
    margin-left: 60px;   
}

e:这是我的jsfiddle: https://jsfiddle.net/13r07wwp/

我希望,你会理解我的问题。抱歉我的英语不好。 :d

0 个答案:

没有答案
相关问题