快捷导航

javascript怎样点击不同的数字,alert出不同的话语

[复制链接]
匿名  发表于 2012-10-24 23:17:16 |阅读模式
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://wenwen.soso.com/z/UrlAlertPage.e?sp=Shttp%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2FDTD%2Fxhtml1-transitional.dtd%22%3E
<html xmlns=" http://wenwen.soso.com/z/UrlAlertPage.e?sp=Shttp%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%3E
<head>
<title>翻牌效果</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=" http://wenwen.soso.com/z/UrlAlertPage.e?sp=Shttp%3A%2F%2Fwww.codefans.net%2Fajaxjs%2Fjquery1.3.2.js%22%3E%3C%2Fscript%3E
<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").click(function(){

alert("再来一次! ");

})
})
</script>
</head>
<body>
翻牌<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>
来自搜搜问问
回复

使用道具

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

本版积分规则

QQ|建材|家居建材|O2O|建材网|Archiver|手机版|小黑屋|博一社区 ( 粤ICP备07502877号-28 )

GMT+8, 2025-8-18 05:04 , Processed in 0.022636 second(s), 17 queries .

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