茄子在线看片免费人成视频,午夜福利精品a在线观看,国产高清自产拍在线观看,久久综合久久狠狠综合

    <s id="ddbnn"></s>
  • <sub id="ddbnn"><ol id="ddbnn"></ol></sub>

  • <legend id="ddbnn"></legend><s id="ddbnn"></s>

    jQuery實現(xiàn)背景彈性滾動的導(dǎo)航效果
    來源:易賢網(wǎng) 閱讀:1119 次 日期:2016-06-17 14:22:30
    溫馨提示:易賢網(wǎng)小編為您整理了“jQuery實現(xiàn)背景彈性滾動的導(dǎo)航效果”,方便廣大網(wǎng)友查閱!

    這篇文章主要介紹了jQuery實現(xiàn)背景彈性滾動導(dǎo)航效果的方法,涉及jQuery動態(tài)操作頁面元素樣式的相關(guān)技巧,需要的朋友可以參考下

    本文實例講述了jQuery實現(xiàn)背景彈性滾動的導(dǎo)航效果。分享給大家供大家參考,具體如下:

    代碼如下:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <title>背景彈性滾動的導(dǎo)航效果</title>

    <meta http-equiv="content-type" content="text/html;charset=gb2312" />

    <!--把下面代碼加到<head>與</head>之間-->

    <style type="text/css">

    .nav-wrap {

    margin: 0 auto;

    background-color: #121212;

    border-top: 1px solid #FFF;

    border-bottom: 1px solid #FFF;

    }

    .group:after {

    visibility: hidden;

    display: block;

    font-size: 0;

    content: " ";

    clear: both;

    height: 0;

    }

    *:first-child+html .group { /* IE7 */

    zoom: 1;

    }

    #example {

    width: 960px;

    margin: 0 auto;

    list-style: none;

    position: relative;

    }

    #example li {

    display: inline;

    }

    #example li a {

    position: relative;

    z-index: 200;

    color: #AAA;

    font-size: 14px;

    display: block;

    float: left;

    padding: 12px 10px 10px 10px;

    text-decoration: none;

    text-transform: uppercase;

    }

    #example li a:hover {

    color: #FFF;

    }

    #example #magic-line-two {

    width: 100px;

    position: absolute;

    top: 0;

    left: 0;

    background: #666;

    z-index: 100;

    -moz-border-radius: 5px;

    -webkit-border-radius: 5px;

    }

    .current a {

    color: #FFF !important;

    }

    </style>

    <script type="text/javascript" src="jquery.min.js"></script>

    <script type="text/javascript">

    $(function(){

    var $el, leftPos, newWidth,

    $mainNav = $("#example");

    /*

    EXAMPLE

    */

    $mainNav.append("<li id='magic-line-two'></li>");

    var $magicLineTwo = $("#magic-line-two");

    $magicLineTwo

    .width($(".current").width())

    .height($mainNav.height())

    .css("left", $(".current a").position().left)

    .data("origLeft", $(".current a").position().left)

    .data("origWidth", $magicLineTwo.width())

    .data("origColor", $(".current a").attr("rel"));

    $("#example li").find("a").hover(function() {

    $el = $(this);

    leftPos = $el.position().left;

    newWidth = $el.parent().width();

    $magicLineTwo.stop().animate({

    left: leftPos,

    width: newWidth,

    backgroundColor: $el.attr("rel")

    })

    }, function() {

    $magicLineTwo.stop().animate({

    left: $magicLineTwo.data("origLeft"),

    width: $magicLineTwo.data("origWidth"),

    backgroundColor: $magicLineTwo.data("origColor")

    });

    });

    });

    </script>

    </head>

    <body>

    預(yù)覽效果時左下角會提示錯誤,而且看不到效果,刷新一下就可以看到效果了;當(dāng)然,在實際使用中,不會出現(xiàn)這樣的問題。<br>

    <!--把下面代碼加到<body>與</body>之間-->

    <div class="nav-wrap">

    <ul class="group" id="example">

    <li class="current"><a href="#" _fcksavedurl="#">Home</a></li>

    <li><a href="#" _fcksavedurl="#">About me</a></li>

    <li><a href="#" _fcksavedurl="#">Our Team</a></li>

    <li><a href="#" _fcksavedurl="#">Portfolio</a></li>

    <li><a href="#" _fcksavedurl="#">The Show</a></li>

    <li><a href="#" _fcksavedurl="#">Videos</a></li>

    <li><a href="#" _fcksavedurl="#">CSS/HTML</a></li>

    <li><a href="#" _fcksavedurl="#">jQuery</a></li>

    <li><a href="#" _fcksavedurl="#">Navigation</a></li>

    <li><a href="#" _fcksavedurl="#">Wordpress</a></li>

    <li><a href="#" _fcksavedurl="#">Contact</a></li>

    </ul>

    </div>

    </body>

    </html>

    希望本文所述對大家jQuery程序設(shè)計有所幫助。

    更多信息請查看網(wǎng)絡(luò)編程
    易賢網(wǎng)手機網(wǎng)站地址:jQuery實現(xiàn)背景彈性滾動的導(dǎo)航效果
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2026上岸·考公考編培訓(xùn)報班

    • 報班類型
    • 姓名
    • 手機號
    • 驗證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點 | 投訴建議
    工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報警專用圖標(biāo)