解决方案 »

  1.   

    使用live是不是选择器中要使用类型啊,例如你这个控件如果是button,那么就如下$("button").live("mouseover",function(){
            $(this).removeClass("showimg2");
            $(this).addClass("showimg2_2");
        });
      

  2.   

    如果是个DIV的话要怎么写?class是showimg2
      

  3.   

    楼主,你的jquery的版本是不是高于1.7,如果是的话,live这个方法被弃用了,可以改用on,具体的看官方文档。
      

  4.   

    如果你用的是1.9+,1.9版本开始.live()方法被弃用.使用.on()
      

  5.   


    一般live或on用于动态生成的dom元素
      

  6.   

    $(".showimg2").live(mouseover:function(){
            $(this).removeClass("showimg2");
    },mouseout:function(){
            $(this).addClass("showimg2");
        });