会jquery的朋友帮个忙,初学不太懂,为什么我写的两个按钮触发的事件都不起作用啊,一点反应都没有
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/...
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<style>
#block1{
background-color:#bca;
width:200px;
height:1.1em;
text-align:center;
border:2px solid green;
margin:3px;
font-size:14px;
}
</style>
<script >
$(function(){
$("#go").click(function(){
$(".block").animate( { 'backgroundColor':'#111111' }, 1000)
.animate( { 'backgroundColor':'#cccccc' }, 1000);
});
$("#go2").click(function(){
$("#block2").animate( { width:"90%"}, 1000 )
.animate( { fontSize:"24px" } , 1000 )
.animate( { borderLeftWidth:"15px" }, 1000);
});
})
</script>
</head>
<body>
<div style="width:900px; margin:0px auto; border:1px solid #333;">
<div style="height:1000px;">
<input name="" type="button" id="go" value="» 按钮一"/>
<div style="width:100px; height:100px; background-color:#060;" class="block"></div>
<button id="go2">» 按钮二</button>
<div id="block1">Block1</div>
</div>
</div>
</body>
</html> 展开
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<style>
#block1{
background-color:#bca;
width:200px;
height:1.1em;
text-align:center;
border:2px solid green;
margin:3px;
font-size:14px;
}
</style>
<script >
$(function(){
$("#go").click(function(){
$(".block").animate( { 'backgroundColor':'#111111' }, 1000)
.animate( { 'backgroundColor':'#cccccc' }, 1000);
});
$("#go2").click(function(){
$("#block2").animate( { width:"90%"}, 1000 )
.animate( { fontSize:"24px" } , 1000 )
.animate( { borderLeftWidth:"15px" }, 1000);
});
})
</script>
</head>
<body>
<div style="width:900px; margin:0px auto; border:1px solid #333;">
<div style="height:1000px;">
<input name="" type="button" id="go" value="» 按钮一"/>
<div style="width:100px; height:100px; background-color:#060;" class="block"></div>
<button id="go2">» 按钮二</button>
<div id="block1">Block1</div>
</div>
</div>
</body>
</html> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询