Est-ce que quelqu'un sait s'il existe un moyen de créer une image en niveaux de gris en survol - autrement qu'en créant 2 images distinctes et en modifiant le src.jquery en niveaux de gris sur hover
grâce
EDIT - CODE SEMI DE TRAVAIL ...:
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="scripts/pixastic-1.custom.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var img = $(".test img")
$('.test').hover(function() {
$('img', this).pixastic("desaturate");
}, function() {
$(this).html(img);
});
});
</script>
et
<div class="test" style="padding:25px; width:200px; background-color:#F96">
<img class="pic" src="images/home/mainImage/family_woods.jpg" width="100" height="100" alt="" />
</div>
Comment puis-je modifier cela fonctionne s'il y a plus d'un div sur la page ... comme ça ...
<div class="test" style="padding:25px; width:200px; background-color:#F96">
<img class="pic" src="images/home/mainImage/family_woods.jpg" width="100" height="100" alt="" />
</div>
<div class="test" style="padding:25px; width:200px; background-color:#F96">
<img class="pic" src="images/home/mainImage/another_image.jpg" width="100" height="100" alt="" />
</div>
Solution possible: http: // stackoverflow.com/questions/2474333/jquery-convertir-image-to-grayscale – Alec
Vous pouvez vérifier cette démo: http://www.sohtanaka.com/web-design/examples/hover-over-trick/ –
C'est par en utilisant par [deux images] (http://www.sohtanaka.com/web-design/examples/hover-over-trick/sushiandrobots_thumb.gif). – Alec