简单jQuery效果

HTML

<html>
<head>
<title></title>
<script type="text/javascript" src="/Scripts/jquery-1.5.1.min.js"></script>
<script type="text/javascript">
var start_flag=0;
$(document).ready(
function(){
$(
"#start").click(function(){
if(start_flag==0)
{
$(
"#box").animate({height:10},"slow");
$(
"#box").animate({width:10},"slow");
start_flag
=1;
}
else
{
$(
"#box").animate({width:200},"slow");
$(
"#box").animate({height:300},"slow");
start_flag
=0;
}
});
});

$(document).ready(
function(){
$(
".flip").click(function(){
$(
".panel").slideToggle("slow");
});
});

</script>
<style type="text/css">
div.panel,p.flip
{
margin
:0px;
padding
:5px;
text-align
:center;
background
:#e5eecc;
border
:solid 1px #c3c3c3;
}
div.panel
{
height
:120px;
display
:none;
}
</style>
</head>

<body>

<div class="panel">
<p>jQuery slideToggle效果</p>
<p>jQuery slideToggle效果演示</p>
</div>

<p class="flip">击这里</p>

<p><a href="#" id="start">击这里</a></p>

<div id="box"
style
="background:#98bf21;height:300px;width:200px;position:relative">
</div>

</body>
</html>

 

^_^



posted on 2011-12-30 06:31 getpro 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/getpro/archive/2011/12/30/2306891.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值