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

jquery mouseover 事件的问题
mouseover有效果,但是mouseout没有效果,这是为什么? 图片地址都是对的!
$(document).ready(function(){
  $("button").mouseover(function(){
    $(this).css("background","url(../images/add-button-over.gif) repeat -x");
  });
  $("button").mouseout(function(){
    $(this).css("background","url(../images/add-button.gif) repeat -x");
  });
});

<button>保存</button>

------解决方案--------------------
 repeat -x
 没有空格
$(document).ready(function(){
  $("button").mouseover(function(){
    $(this).css("background","url(http://img0.bdstatic.com/img/image/shouye/zxzzyyh.jpg) repeat-x");
  });
  $("button").mouseout(function(){
    $(this).css("background","url(http://img0.bdstatic.com/img/image/shouye/sjwysji11.jpg) repeat-x");
  });
});