按钮是顶部的六个方形图像。
http://wthdesign.net/test/rollover/services.html
我使用的代码:
$( document ).ready(function() {
$('.originalImg,rollOverImg').hover(
function () {
$(this).next().stop().animate({left: '0'}, 500, function(){});
console.log("in");
},
function () {
$(this).next().stop().animate({left: '90px'}, 500, function(){});
console.log("out");
}
);
我的html:
<div class="slicesBoxesTop"><img class="originalImg" src="images/home.png" /><img class="rollOverImg" src="http://makingdesign.com.au/images/mickslice1.gif" width="90" height="90" /></div>
<div class="slicesBoxTop2"><img class="originalImg" src="images/home.png" /><img class="rollOverImg" src="http://makingdesign.com.au/images/paulslice2.gif" width="90" height="90" /></div>
<div class="sliceTop3"><img class="originalImg" src="images/home.png" /><img class="rollOverImg" src="http://makingdesign.com.au/images/mickslice2.gif" width="90" height="90" /></div>
<div class="sliceTop4"><img class="originalImg" src="images/home.png" /><img class="rollOverImg" src="http://makingdesign.com.au/images/paulslice3.gif" width="90" height="90" /></div>
<div class="sliceTopbox5"><img class="originalImg" src="images/home.png" /><img class="rollOverImg" src="http://makingdesign.com.au/images/mickslice3.gif" width="92" height="92" /></div>
出于某种原因,即使我的光标仍悬停在图像上,它也会自动推出。