国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

jQuery實(shí)現(xiàn)個性翻牌效果導(dǎo)航菜單的方法

2024-05-06 16:16:22
字體:
供稿:網(wǎng)友
這篇文章主要介紹了jQuery實(shí)現(xiàn)個性翻牌效果導(dǎo)航菜單的方法,實(shí)例分析了jQuery操作animate、css及鼠標(biāo)事件的技巧,具有一定參考借鑒價值,需要的朋友可以參考下
 

本文實(shí)例講述了jQuery實(shí)現(xiàn)個性翻牌效果導(dǎo)航菜單的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

 

復(fù)制代碼代碼如下:

<!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>jQuery個性翻牌效果的導(dǎo)航菜單</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<style type="text/css">
ul,li{list-style:none;padding:0;margin:0;}
#btncell{width:300px;height:100px;border:1px solid #777;margin:50px auto;}
#btncell li{width:100px;float:left;height:50px;font-size:14px;text-align:center;line-height:28px;position:relative;z-index:1;}
#btncell li a{display:block;height:28px;border:2px solid #333;text-decoration:none;width:50px;background:#888;overflow:hidden;position:absolute;left:25px;top:10px;}
</style>
<script type="text/javascript" src="js/jquery1.3.2.js"></script>
<script language="javascript">
var nummove=0;
var numout=0;
$(function(){
    $("#btncell li").hover(
        function(){
        if(nummove==0)
        {
            nummove=1;
            $("a",this).animate({ height: "0px",top: "25px"}, 80,function(){nummove=0;});
            $("a",this).animate({ height: "28px",top: "10px"}, 80);
            $("a",this).css("background","yellow");
        }
            },
            function(){
            if(numout==0)
            {
            numout=1;
            $("a",this).animate({ height: "0px",top: "25px"}, 80,function(){numout=0;});
            $("a",this).animate({ height: "28px",top: "10px"}, 80);
            $("a",this).css("background","#888");
            numout=0;
            }
            }
    )
    $("#btncell li a").click(function(){
        $(this).parents("li").css("z-index","2")
        $(this).animate({ height: "558px",top: "-255px",width: "1000px",left: "-460px",opacity: 'toggle',lineHeight: '558px',fontSize: '500px'}, 1000);
        $(this).animate({ height: "28px",top: "10px",width: "50px",left: "25px",opacity: 'toggle',lineHeight: '28px',fontSize: '12px'}, 400);
        $(this).parents("li").css("z-index","1")
    })
})
</script>
</head>
<body>
預(yù)覽效果時左下角會提示錯誤,而且看不到效果,刷新一下就可以看到效果了。<ul id="btncell">
  <li><a href="#">1</a></li>
  <li><a href="#">2</a></li>
  <li><a href="#">3</a></li>
  <li><a href="#">4</a></li>
  <li><a href="#">5</a></li>
  <li><a href="#">6</a></li>
</ul>
</body>
</html>

 

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


發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 昌平区| 鄂州市| 富平县| 阳山县| 昔阳县| 安宁市| 富平县| 汝阳县| 邳州市| 库车县| 清河县| 朝阳区| 临邑县| 苗栗县| 右玉县| 宜宾县| 左权县| 响水县| 永泰县| 利辛县| 绥德县| 巧家县| 泽普县| 峨眉山市| 视频| 西盟| 丰顺县| 淄博市| 翼城县| 永顺县| 延吉市| 彰化市| 武邑县| 辉县市| 玉林市| 乐陵市| 永城市| 六安市| 贵南县| 林周县| 石城县|