我想改变悬停时div的背景图像宽度。我的代码是:悬停时用动画改变div背景图像的宽度
HTML:
<div class="block2 todrop" target="regbuyer.php"></div>
CSS:
.col1 .block2 { float: right; margin: 104px 0 0 0; width: 208px; height: 104px; background: url(../images/block2-1.jpg) no-repeat center center; background-size: 100% 100%; }
.todrop { cursor: pointer; }
'.live()'已经被废弃了很长一段时间。我们使用'$('static_element')。on('event','dynamic_element',function(){// do work});'now。 – Ohgodwhy