弘帝企业智能建站系统交流平台

 找回密码
 立即注册
查看: 2783|回复: 0

【jQuery】animate翻牌特效

[复制链接]
发表于 2015-12-5 10:31:20 | 显示全部楼层 |阅读模式
var nummove=0;
var numout=0;
$(function(){
        $("#btncell li").hover(
                function(){
                if(nummove==0)
                {
                        nummove=1;
//this为hover容器,a为标签作为显示牌
//$("a",this)this下a标签动画,height为this a缩变为0,top为this标签高度一半值
                        $("a",this).animate({ height: "0px",top: "25px"}, 80,function(){nummove=0;});
//$("a",this)this下a标签动画,height为this a恢复到原值,top为this回位到原值
                        $("a",this).animate({ height: "28px",top: "0px"}, 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: "0px"}, 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")
        })
})


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|弘帝企业智能建站系统 ( 皖ICP备07503252号 )

GMT+8, 2024-5-2 07:03 , Processed in 0.107456 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表