jquery变色动画下拉菜单特效代码

版权:原创 更新时间:1年以上
[该文章底部包含文件资源,可根据自己情况,决定是否下载资源使用,时间>金钱,如有需要,立即查看资源]

以下是 jquery变色动画下拉菜单特效代码 的示例演示效果:

当前平台(PC电脑)
  • 平台:

部分效果截图:

jquery变色动画下拉菜单特效代码

HTML代码(index.html):

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>jquery变色动画下拉菜单</title>
    <link href="css/webwidget_menu_dropdown.css" rel="stylesheet" type="text/css"></link>
    <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="js/webwidget_menu_dropdown.js"></script>
    <style type="text/css">
        h2 {
            color: red;
        }

        pre {
            padding: 4px;
            border: #F90 dotted 1px;
        }
    </style>
</head>
<body>
    <script language="javascript" type="text/javascript">
        $(function () {
            $("#webwidget_menu_dropdown").webwidget_menu_dropdown({
                m_w: '100',
                m_t_c: '#FFF',
                m_c_c: '#8FC45A',
                m_bg_c: '#56A901',
                m_b_s: '2',
                m_bg_h_c: '#8FC45A',
                s_s: 'fast',
                m_s: 'small'
            });
            $("#webwidget_menu_dropdown1").webwidget_menu_dropdown({
                m_w: '100',
                m_t_c: '#CCC',
                m_c_c: '#666',
                m_bg_c: '#000',
                m_b_s: '2',
                m_bg_h_c: '#666',
                s_s: 'fast',
                m_s: 'medium'
            });
        });

    </script>
    <h1>Multicolor animation drop down navigation menu with jQuery</h1>
    <h2>Demo1</h2>
    <div id="webwidget_menu_dropdown" class="webwidget_menu_dropdown">
        <ul>
            <li class="current">
                <a href="link1">Menu1</a>
                <ul>
                    <li>
                        <a href="link1">submenu1</a>
                    </li>
                    <li><a href="link2">submenu2</a></li>
                    <li><a href="link3">submenu3</a></li>
                    <li><a href="link4">submenu4</a></li>
                    <li><a href="link5">submenu5</a></li>
                    <li><a href="link6">submenu6</a></li>
                </ul>
            </li>
            <li>
                <a href="link2">Menu2</a>
                <ul>
                    <li>
                        <a href="link1">submenu1</a>
                    </li>
                    <li><a href="link2">submenu2</a></li>
                    <li><a href="link3">submenu3</a></li>
                    <li><a href="link4">submenu4</a></li>
                    <li><a href="link5">submenu5</a></li>
                    <li><a href="link6">submenu6</a></li>
                </ul>
            </li>
            <li>
                <a href="link3">Menu3</a>
                <ul>
                    <li>
                        <a href="link1">submenu1</a>
                    </li>
                    <li><a href="link2">submenu2</a></li>
                    <li><a href="link3">submenu3</a></li>
                    <li><a href="link4">submenu4</a></li>
                    <li><a href="link5">submenu5</a></li>
                    <li><a href="link6">submenu6</a></li>
                </ul>
            </li>
            <li>
                <a href="link4">Menu4</a>
                <ul>
                    <li>
                        <a href="link1">submenu1</a>
                    </li>
                    <li><a href="link2">submenu2</a></li>
                    <li><a href="link3">submenu3</a></li>
                    <li><a href="link4">submenu4</a></li>
                    <li><a href="link5">submenu5</a></li>
                    <li><a href="link6">submenu6</a></li>
                </ul>
            </li>
            <li>
                <a href="link5">Menu5</a>
                <ul>
                    <li>
                        <a href="link1">submenu1</a>
                    </li>
                    <li><a href="link2">submenu2</a></li>
                    <li><a href="link3">submenu3</a></li>
                    <li><a href="link4">submenu4</a></li>
                    <li><a href="link5">submenu5</a></li>
                    <li><a href="link6">submenu6</a></li>
                </ul>
            </li>
            <li>
                <a href="link6">Menu6</a>
                <ul>
                    <li>
                        <a href="link1">submenu1</a>
                    </li>
                    <li><a href="link2">submenu2</a></li>
                    <li><a href="link3">submenu3</a></li>
                    <li><a href="link4">submenu4</a></li>
                    <li><a href="link5">submenu5</a></li>
                    <li><a href="link6">submenu6</a></li>
                </ul>
            </li>
        </ul>
        <div style="clear: both"></div>
    </div>
    <h2>Demo2</h2>
    <div id="webwidget_menu_dropdown1" class="webwidget_menu_dropdown">
        <ul>
            <li class="current">
                <a href="link1">Menu1</a>
                <ul>
                    <li>
                        <a href="link1">submenu1</a>
                    </li>

                    <li><a href="link2">submenu2</a></li>

                    <li><a href="link3">submenu3</a></li>
                    <li><a href="link4">submenu4</a></li>
                    <li><a href="link5">submenu5</a></li>
                    <li><a href="link6">submenu6</a></li>
                </ul>

            </li>
            <li>
                <a href="link2">Menu2</a>

                <ul>
                    <li>
                        <a href="link1">submenu1</a>
                    </li>
                    <li><a href="link2">submenu2</a></li>
                    <li><a href="link3">submenu3</a></li>

                    <li><a href="link4">submenu4</a></li>
                    <li><a href="link5">submenu5</a></li>

                    <li><a href="link6">submenu6</a></li>
                </ul>
            </li>
            <li>
                <a href="link3">Menu3</a>

                <ul>
                    <li>
                        <a href="link1">submenu1</a>
                    </li>

                    <li><a href="link2">submenu2</a></li>
                    <li><a href="link3">submenu3</a></li>
                    <li><a href="link4">submenu4</a></li>

                    <li><a href="link5">submenu5</a></li>
                    <li><a href="link6">submenu6</a></li>
                </ul>
            </li>

            <li>
                <a href="link4">Menu4</a>
                <ul>
                    <li>
                        <a href="link1">submenu1</a>

                    </li>
                    <li><a href="link2">submenu2</a></li>
                    <li><a href="link3">submenu3</a></li>
                    <li><a href="link4">submenu4</a></li>

                    <li><a href="link5">submenu5</a></li>
                    <li><a href="link6">submenu6</a></li>

                </ul>
            </li>

        </ul>
        <div style="clear: both"></div>
    </div>
</body>
</html>

JS代码(webwidget_menu_dropdown.js):

(function(a){
	a.fn.webwidget_menu_dropdown=function(p){
	var p=p||{
}
;
	var g=p&&p.m_t_c?p.m_t_c:"blue";
	var h=p&&p.m_b_s?p.m_b_s:"1";
	var i=p&&p.m_bg_c?p.m_bg_c:"#FFF";
	var j=p&&p.m_w?p.m_w:"100";
	var k=p&&p.m_bg_h_c?p.m_bg_h_c:"red";
	var l=p&&p.m_c_c?p.m_c_c:"red";
	var m=p&&p.m_s?p.m_s:"medium";
	var n=p&&p.s_s?p.s_s:"fast";
	h = h+'px';
	j = j+'px';
	var o=a(this);
	if(o.children("ul").length==0||o.children("ul").children("li").length==0){
	o.append("Require menu content");
	return null}
s_m_b(o.children("ul").children("li"),o.find("li"),h,i,j,l);
	s_m_t_c(o.find("a"),g);
	s_m_s(o,m);
	o.children("ul").children("li").hover(function(){
	if(n=='no-wait'){
	$(this).children("ul").show()}
else{
	$(this).children("ul").slideDown(n)}
}
,function(){
	if(n=='no-wait'){
	$(this).children("ul").hide()}
else{
	$(this).children("ul").slideUp(n)}
}
);
	o.children("ul").children("li").children("ul").children("li").hover(function(){
	$(this).css("background-color",k)}
,function(){
	$(this).css("background-color",i)}
);
	function s_m_s(a,b){
	switch(b){
	case'large':menu_height='40px';
	sub_menu_height='30px';
	font_size='16px';
	a_padding='10px';
	break;
	case'medium':sub_menu_height='25px';
	font_size='13px';
	menu_height='30px';
	a_padding='5px';
	break;
	case'small':sub_menu_height='20px';
	font_size='12px';
	menu_height='20px';
	a_padding='2px';
	break;
	default:sub_menu_height='25px';
	font_size='13px';
	menu_height='35px';
	a_padding='10px'}
o.children("ul").css("font-size",font_size);
	o.children("ul").children("li").css("height",menu_height);
	o.children("ul").children("li").children("a").css("line-height",menu_height);
	o.children("ul").children("li").children("a").css("padding",a_padding);
	o.children("ul").children("li").children("ul").css("top",menu_height);
	o.children("ul").children("li").children("ul").css("left","0px");
	o.children("ul").children("li").children("ul").children("li").children("a").css("line-height",sub_menu_height)}
function s_m_t_c(a,b){
	a.css("color",b)}
function s_m_b(a,b,c,d,e,f){
	style="background-color:"+d+";
	margin-left:"+c+";
	width:"+e+";
	";
	a.attr("style",style);
	a.filter(".current").css("background-color",f);
	style1="background-color:"+d+";
	width:"+e+";
	";
	b.children("ul").attr("style",style1)}
}
}
)(jQuery);
	

CSS代码(webwidget_menu_dropdown.css):

.webwidget_menu_dropdown ul{padding:0px;margin:0px;font-family:Arial;}
.webwidget_menu_dropdown ul li{-moz-border-radius-topright:7px;-moz-border-radius-topleft:7px;-webkit-border-top-left-radius:7px;-webkit-border-top-right-radius:7px;-khtml-border-radius-topright:7px;-khtml-border-radius-topleft:7px;border-radius-topright:7px;border-radius-topleft:7px;border-radius:7px;float:left;list-style:none;position:relative;text-align:center;}
.webwidget_menu_dropdown ul li a{text-decoration:none;font-weight:bold;}
.webwidget_menu_dropdown ul li ul{-moz-border-radius-bottomright:7px;-moz-border-radius-bottomleft:7px;-webkit-border-bottom-left-radius:7px;-webkit-border-bottom-right-radius:7px;-khtml-border-radius-bottomright:7px;-khtml-border-radius-bottomleft:7px;border-radius-bottomright:7px;border-radius-bottomleft:7px;border-radius:7px;padding-bottom:5px;position:absolute;z-index:999999;display:none;}
.webwidget_menu_dropdown ul li ul li{-moz-border-radius-topright:0px;-moz-border-radius-topleft:0px;-webkit-border-top-left-radius:0px;-webkit-border-top-right-radius:0px;-khtml-border-radius-topright:0px;-khtml-border-radius-topleft:0px;border-radius-topright:0px;border-radius-topleft:0px;border-radius:0px;margin:0px;float:none;border:none;word-wrap:break-word;}
.webwidget_menu_dropdown ul li ul li a{padding-left:5px;padding-right:5px;font-weight:normal;}
#roundCorderC{font-family:Arial;border:5px solid #dedede;-moz-border-radius:15px;-webkit-border-radius:15px;padding:15px 25px;height:inherit;width:590px;}
附件:下载该文件资源,减少时间成本(增值服务)
留言
该资源可下载
File Source
.rar
22.51 KB
Html Js 菜单导航特效1
最新结算
股权转让协议意向书模板
类型: .docx 金额: CNY 2.23¥ 状态: 待结算 详细>
股权转让协议意向书模板
类型: .docx 金额: CNY 0.28¥ 状态: 待结算 详细>
CSS3图片向上3D翻转渐隐消失特效
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
CSS3图片向上3D翻转渐隐消失特效
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
.net c# 将金额转人名币大写金额
类型: .rar 金额: CNY 2.39¥ 状态: 待结算 详细>
.net c# 将金额转人名币大写金额
类型: .rar 金额: CNY 0.3¥ 状态: 待结算 详细>
合伙退伙协议书范本模板
类型: .doc 金额: CNY 2.23¥ 状态: 待结算 详细>
合伙退伙协议书范本模板
类型: .doc 金额: CNY 0.28¥ 状态: 待结算 详细>
合伙退伙协议书范本模板
类型: .doc 金额: CNY 2.23¥ 状态: 待结算 详细>
合伙退伙协议书范本模板
类型: .doc 金额: CNY 0.28¥ 状态: 待结算 详细>
我们力求给您提供有用的文章,再此基础上,会附加营收资源,不做任何广告,让平台可以更好发展 若您发现您的权利被侵害,或使用了您的版权,请发邮件联系 sunlifel@foxmail.com ggbig觉得 : 不提供源码的文章不是好文章
合作伙伴
联系我们
  • QQ:21499807
  • 邮箱:sunlifel@foxmail.com
  • QQ扫一扫加QQ
    QQ扫一扫
Copyright 2023-2024 ggbig.com·皖ICP备2023004211号-1
打赏文章