Bonsoir,
JavaScript
jQuery(document).ready(function($){
$('.movebox').mouseover(function(){
$(this).find('div:first').stop().animate({
marginTop : -20
},300);
}).mouseout(function(){
$(this).find('div:first').stop().animate({
marginTop : 0
},300);
});
});
Html
<div class="movebox" style="width: 20px;height: 20px; overflow: hidden;">
<div style="width: 20px;height: 20px; background-color: red;"></div>
<div style="width: 20px;height: 20px; background-color: green;"></div>
</div>
<div class="movebox" style="width: 20px;height: 20px; overflow: hidden;">
<div style="width: 20px;height: 20px; background-color: yellow;"></div>
<div style="width: 20px;height: 20px; background-color: blue;"></div>
</div>
<div class="movebox" style="width: 20px;height: 20px; overflow: hidden;">
<div style="width: 20px;height: 20px; background-color: blueviolet;"></div>
<div style="width: 20px;height: 20px; background-color: burlywood;"></div>
</div>