0
J'essaie d'obtenir un div sur ma page pour avoir un effet planant. Je crois que je l'ai codé correctement, ça ne marche tout simplement pas. Voici mon code.Comment obtenir ce div pour avoir un effet de survol?
Merci pour toute aide à l'avance!
Click here for a JSfiddle of my problem.
Javascript -
$(document).ready(function(){
$(function() {
function creeperFloat() {
$('.creeper').animate({
left: '+=35',
top: '+=25'
}, 4500).animate({
left: '-=35',
top: '-=25'
}, 4500, creeperFloat);
}
creeperFloat();
});
creeperFloat();
});
HTML -
<div class="creeper">
</div>
CSS -
.creeper {
background: transparent url(http://s14.postimg.org/bsrst8btt/spacecreep.png) 50% 0 no-repeat;
position: absolute;
width: 300px;
height: 200px;
top: 175px;
left: 58%;
z-index:5;
display:block;
}
Entièrement oublié de l'importer, haha. Je vous remercie! –