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

急求jquery问题
html

<li>
        <div class="NewsIMG"><img  src="Admin/FileUpload/20130719104147.jpg"/></div>
        <div  class="NewsTI"  > 
            1112
      </div>
        </div>
        <div class="NewsTIB"></div>     <div class="NewsTIA">查看详细</div>           
</li>
         
 <li>
        <div class="NewsIMG"><img  src="Admin/FileUpload/20130719103609.jpg"/></div>
        <div  class="NewsTI"  > 
          22223
       </div>
        </div>
        <div class="NewsTIB"></div>     <div class="NewsTIA">查看详细</div>           
  </li>



jquery

<script type="text/javascript">
        $(function () {
            $(".NewsTIA").each(function (index, item) {
                $(this).click(function () {
                    if($(this).text() == "查看详细")
                    {
                        $(this).text("关闭详细");
                        $(".NewsTII").eq(index).removeClass().addClass("01");
                    }else
                    {
                        $(this).text("查看详细")