这段js代码为什么执行不成功,点击按钮没有反应。
<!DOCYPEhtml><html><head><title>jqerygoestodom-ville</title><style>#change_me{positio...
<!DOCYPE html>
<html>
<head>
<title>jqery goes to dom-ville</title>
<style>
#change_me{
position:absolute;
top:100px;
left:400px:
font:24px arial;}
#move_up #move_down #color #disappear
{
padding: 5px;}
</style>
<script src="scripts/jquery-1.6.2.min.js"></script>
</head>
<body>
<button id="move_up">move up</button>
<button id="move_down">move down</button>
<button id="color">color</button>
<button id="disappear">disappear/re_appear</button>
<div id="change_me">make me to stuff</div>
<script>
$(document).ready(functio(){
$("#move_up").ready(function(){
$("#change_me").animate({top:30},200);});
$("#move_down").ready(function(){
$("#change_me").animate({top:500},2000);});
$("#color").click(function(){
$("#change_me").css("color","purple");});
$("#disappear"),click(function(){
$("#change_me").toggle("slow");});
});
</script></body></html> 展开
<html>
<head>
<title>jqery goes to dom-ville</title>
<style>
#change_me{
position:absolute;
top:100px;
left:400px:
font:24px arial;}
#move_up #move_down #color #disappear
{
padding: 5px;}
</style>
<script src="scripts/jquery-1.6.2.min.js"></script>
</head>
<body>
<button id="move_up">move up</button>
<button id="move_down">move down</button>
<button id="color">color</button>
<button id="disappear">disappear/re_appear</button>
<div id="change_me">make me to stuff</div>
<script>
$(document).ready(functio(){
$("#move_up").ready(function(){
$("#change_me").animate({top:30},200);});
$("#move_down").ready(function(){
$("#change_me").animate({top:500},2000);});
$("#color").click(function(){
$("#change_me").css("color","purple");});
$("#disappear"),click(function(){
$("#change_me").toggle("slow");});
});
</script></body></html> 展开
1个回答
2015-08-24
展开全部
<!DOCYPE html>
<html>
<head>
<title>已修改,采纳即可</title>
<style>
#change_me {
position: absolute;
top: 100px;
left: 400px:
font:24px arial;
}
#move_up #move_down #color #disappear {
padding: 5px;
}
</style>
<script src="scripts/jquery-1.6.2.min.js"></script>
</script>
</head>
<body>
<button id="move_up">move up</button>
<button id="move_down">move down</button>
<button id="color">color</button>
<button id="disappear">disappear/re_appear</button>
<div id="change_me">make me to stuff</div>
<script>
// function写错
$(document).ready(function() {
$("#move_up").ready(function() {
$("#change_me").animate({
top: 30
}, 200);
});
$("#move_down").ready(function() {
$("#change_me").animate({
top: 500
}, 2000);
});
$("#color").click(function() {
$("#change_me").css("color", "purple");
});
// 点号,写成了逗号,错错错
$("#disappear").click(function() {
$("#change_me").toggle("slow");
});
});
</script>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询