J'utilise une image d'image-objet pour modifier l'arrière-plan d'un survol et cliquer (la classe .keepImage correspond au clic). Tout fonctionne, mais lorsque l'image de fond change, elle défile à la bonne position. Y a-t-il un moyen de le faire sans le mouvement de défilement?Utilisation d'une image-objet CSS pour l'effet de survol sans l'animation de défilement
JS:
<script>
$(document).ready(function(){
$("a.doing").click(function() {
$(this).siblings(".keepImage").removeClass("keepImage");
$(this).addClass("keepImage");
});
});
</script>
CSS:
a.doing {
width: 229px;
height: 202px;
margin-right: 8px;
background: url(http://localhost:8000/img/manifesto/spr_doing.png) 0 0;
}
a.doing:hover, a.doing.keepImage {
background: url(http://localhost:8000/img/manifesto/spr_doing.png) -229px 0;
}