午夜国产狂喷潮在线观看|国产AⅤ精品一区二区久久|中文字幕AV中文字幕|国产看片高清在线

    jQuery晃動層特效實現(xiàn)方法
    來源:易賢網(wǎng) 閱讀:1260 次 日期:2015-03-11 14:45:50
    溫馨提示:易賢網(wǎng)小編為您整理了“jQuery晃動層特效實現(xiàn)方法”,方便廣大網(wǎng)友查閱!

    這篇文章主要介紹了jQuery晃動層特效實現(xiàn)方法,實例分析了animate方法與css樣式的操作技巧,具有一定參考借鑒價值,需要的朋友可以參考下

    本文實例講述了jQuery晃動層特效實現(xiàn)方法。分享給大家供大家參考。具體實現(xiàn)方法如下:

    代碼如下:

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

    <html xmlns="">

    <head>

    <meta http-equiv="Content-Type" content="text/html;" charset="utf-8" />

    <title>jQuery晃動層</title>

    <style type="text/css">

    body { font: 12px Georgia, serif; }

    a { text-decoration: none; }

    #header{margin:50px auto}

    #header p{text-align:center;font-size:16px;font-weight:bold}

    #box{width:400px;height:200px;background-color:#ccc;text-align:center}

    </style>

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

    <script type="text/javascript">

    var box_left = 0;

    $(document).ready(function () {

    box_left = ($(window).width() - $('#box').width()) / 2;

    $('#box,#footer').css({'left': box_left, 'position':'absolute'});

    });

    function shock()

    {

    for (i = 1; i < 7; i++)

    {

    $('#box').animate({

    'left': '-=15'

    }, 3, function() {

    $(this).animate({

    'left': '+=30'

    }, 3, function() {

    $(this).animate({

    'left': '-=15'

    }, 3, function() {

    $(this).animate({

    'left': box_left

    }, 3, function() {

    // shock end

    });

    });

    });

    });

    }

    }

    </script>

    </head>

    <body>

    <div id="header">

    <p>仿wp后臺登錄錯誤時左右晃動某一層</p>

    </div>

    <div id="box"><a href="#" onclick="shock();return false;">單擊我查看效果</a></div>

    </body>

    </html>

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

    更多信息請查看IT技術(shù)專欄

    更多信息請查看腳本欄目
    易賢網(wǎng)手機網(wǎng)站地址:jQuery晃動層特效實現(xiàn)方法

    2025國考·省考課程試聽報名

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