实现动态切换对象的背景图片

<script type="text/javascript">
 $().ready
 (
     function test2(aaa) {
     $(aaa).hover(
         function()
         {
 
          aa="url('images/"+$(aaa).val()+"')";
          $("#test").css("background",aa);
         },
         function() {
          // $("#test").css("background","none");
         }
 );
});
</script>
<label id="div11" onmousemove='test2(div11)' value="help.gif"></lable>

其中aaa是对象的ID, 数据绑定label 的 ID和Value就可以实现背景切换的效果了

原文地址:https://www.cnblogs.com/wyxy2005/p/1370810.html