本帖最后由 luguo1024802 于 2012-12-04 09:31:48 编辑

解决方案 »

  1.   

    $(this).attr("src","xxx.jpg")  //attr 是这样用的
      

  2.   

    $(this).attr("src",($(this).parent().next().is(":hidden")?"image/xpexpand1_s.gif":"image/xpcollapse1_s.gif");
      

  3.   

     $(this).attr("src")=$(this).parent().next().is(":hidden")?"image/xpexpand1_s.gif":"image/xpcollapse1_s.gif";       
                        
                   });你这个错误 不是= 而是这样
    $(this).attr("src","xxx.jpg") 
    前面一个参数 是属性名,后面是属性值 ,如果你直写一个代码获取当前img的src,写二个就是赋值
      

  4.   

    那句改成这样看看
    this.src=$(this).parent().next().is(":hidden")?"image/xpexpand1_s.gif":"image/xpcollapse1_s.gif";                                             });