日期:2014-05-16  浏览次数:20460 次

初学JQuery 刚写一段代码总是没效果 求指教
HTML code

<!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>
    <title></title>
    <script type="text/javascript" src="jquery-1.3.2.min.js" />
    <script type="text/javascript">
        $(document).ready(
            function(){ 
                $("div.imglinks").click(
                    function(){ 
                        $("li").addClass("ceshi");
                        $("p").addClass("tmpFrameworkLoaded");
                    }
                );
                $("p").click(
                    function(){
                        $("li").removeClass("ceshi");
                    }
                );
            }
        ); 
    </script>
    <style type="text/css">
        ul,li{margin:0px;padding:0px;list-style-type: none;}
        .ceshi{cursor:pointer;background:#EFF8FD;border-left:#B2D1FF 1px solid;border-bottom:#B2D1FF 1px solid;
        border-right:#B2D1FF 1px solid;padding-right:0.5em;padding-left:3.0em;padding-bottom:2px; padding-top:2px;} 
        div.imglinks{width:100px; height:100px; background-color:green}
        p.tmpFrameworkLoaded {color: green;border: 1px solid green;}
    </style>
</head>
<body>
<div class="imglinks"></div>
<ul>
    <li>在这里写你的代码</li>
    <li>要在DOM就绪时执行的函</li>
    <li>在DOM加载完成时运行的代码</li>
</ul>
<p>aaaaaaaaaaaaaaaaa</p>
</body>
</html>



------解决方案--------------------
<script type="text/javascript" src="jquery-1.3.2.min.js" />
-->
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>