日期:2014-05-17  浏览次数:20462 次

jQuery高手帮看一下代码为什么实现不了
想要改变DIV的背景颜色,但是怎么改始终没反应,求高手帮忙看一下哪里出错哦,谢谢了
<!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="script/jquery-2.0.3.js"></script>
<script  language="javascript" type="text/javascript">
$("#one").css("background","red");
$(".mini").css("background","#bbffaa");
$("span,#two").css("background","#0CF");
</script>

<style type="text/css">
div,span,p{
width:140px;
height:140px;
margin:5px;
background:#aaa;
border:1px solid #000;
float:left;
font-size:17px;
font-family:Verdana, Geneva, sans-serif;
}
div.mini{
width:55px;
height:55px;
background:#aaa;
font-size:12px;
}
div.hide{
display:none;
}
</style>

</head>

<body>
<div id="one" class="one" >
<div class="mini"></div>
</div>
<div id="two" class="one" title="test">
<div class="mini" title="other"></div>
<div class="mini" title="test"></div>
</div>
<div class="one">
<div class="mini">为什么不行</div>
<div class="mini"></div>
<div class="mini"></div>
<div class="mini"></div>
</div>
<div class="one">
<div class="mini"></div>
<div class="mini"></div>
<div class="mini"></div>
<div class="mini" title="tesst"></div>
</div>
<div style="display:none;" class="none">
</div>
<div class="hide"></div>
<div>
</div>
<span id="mover"></span> 
</body>
</html>

------解决方案--------------------
<script language="javascript" type="text/javascript">
        $(function () {
            $("#one").css("background", "red");
            $(".mini").css("background", "#bbffaa");
            $("span,#two").css("background", "#0CF");
        });
  &nbs