具体达成情势如下,具体达成格局如下

2019-07-21 作者:小鱼儿主页高手论坛   |   浏览(190)

本文实例叙述了基于jQuery创造鼠标悬停效果的不二等秘书籍。分享给大家供大家参谋。具体达成格局如下:

本文实例汇报了jQuery摆荡层特效落成格局。分享给我们供大家参谋。具体达成格局如下:

本文实例陈诉了jQuery仿Flash上下翻动的中国和高丽国文导航菜单的方式。分享给大家供大家参照他事他说加以考察。具体达成方式如下:

代码特别轻便,这里就相当少废话了,直接上代码:

  1. 创建HTML:

复制代码 代码如下:

复制代码 代码如下:

复制代码 代码如下:

<ul>
<li><a href="/tv"><img src="images/tv_off.gif" class="mainnav"></a></li>
</ul>

<!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>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ";
<html xmlns=";
<head>
<title>jQuery仿Flash鼠标感应式翻动的导航菜单</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<style type="text/css">
body{width:100%;height:100%;margin:0;padding:0;background:url(/jscss/demoimg/201007/bg.gif) repeat-x top center;font-size:12px;color:#616161;}
a,a:link,a:visited,a:active{color:#616161;text-decoration:none;}
a:hover{text-decoration:underline;color:#710075;}
#body{ width:100%;float:left;}
.index_top{width:930px;height:126px;position:relative;z-index:1;}
no-repeat 0 0;position:absolute;top:46px;left:41px;z-index:50;}
#index_nav{margin:82px 0;float:left;display:inline;}
#index_nav ul{float:left;height:34px;display:inline;margin:0 0 0 0px;list-style-type:none;}
#index_nav li{float:left;height:34px;width:100px;font-size:13px;font-family:Verdana;line-height:34px;text-align:center;cursor:pointer;color:#fff;}
#index_nav_cases a,#index_nav_cases a:link,#index_nav_cases a:visited,#index_nav_cases a:active{color:#fff;}
#index_nav_cases a:hover{text-decoration:none;}
#index_nav li div{height:34px;width:100px;overflow:hidden;position:relative;}
#index_nav li div .n1,#index_nav li div .n2{display:block;height:34px;width:100px;position:absolute;top:0px;left:0px;cursor:pointer;}
#index_nav li div .n1{z-index:12;background:url(/jscss/demoimg/201007/nav_bg.gif) repeat-x top center;font-size:13px;}
#index_nav li div .n2{z-index:11;background:url(/jscss/demoimg/201007/nav_bg.gif) repeat-x top center;}
#index_nav li div a{color:#fff;}
#index_nav li div a:hover{text-decoration:none;}
</style>
<script type="text/javascript" src="/ajaxjs/jquery1.3.2.js"></script>
<script type="text/javascript">
jQuery(function(){
    jQuery('#index_nav li').hover(
        function(){
            jQuery(this).find('.n1').stop().animate({opacity:'0',top:'43px'});
        },
        function(){
            jQuery(this).find('.n1').stop().animate({opacity:'1',top:'0px'});
        }
    );
});
</script>
</head>
<body>
<span style="color:#FFFFFF;">  友情提醒:若提醒网页有错或看不到效果,请刷新网页后再试!</span><br>
<div id="body">
    <div id="index_content">
        <div class="index_top">
            <div id="index_nav">
                <ul>
                    <li id="index_nav_about"><div><span class="n1">关 于</span><span class="n2">About</span></div></li>
                    <li id="index_nav_service"><div><span class="n1">服 务</span><span class="n2">Services</span></div></li>
                    <li id="index_nav_cases"><div><a href="#"><span class="n1">案 例</span><span class="n2">Cases</span></a></div></li>
                    <li id="index_nav_adva"><div><span class="n1">优 势</span><span class="n2">Advantages</span></div></li>
                    <li id="index_nav_contact"><div><span class="n1">联 系</span><span class="n2">Contact</span></div></li>
                </ul>
            </div>
        </div>
    </div>
</div>
</body>
</html>

$(document).ready(function(){
    $(document).bind("contextmenu",function(e){
        return false;
    });
});

本文由小鱼儿玄机30码发布于小鱼儿主页高手论坛,转载请注明出处:具体达成情势如下,具体达成格局如下

关键词: 小鱼儿玄机30码