Salve a tutti!
Stavo cercando di implementare un mouse hover funzionante
Codice PHP:
<script type="text/javascript" >
$(document).ready(function() {
$('#oggetto').each(function() {
$(this).hover(
function() {
$('.des').stop().animate({ opacity: 0 }, 400);
$('.norm').stop().animate({ opacity: 1 }, 400);
},
function() {
$('.des').stop().animate({ opacity: 1 }, 400);
$('.norm').stop().animate({ opacity: 0 }, 400);
})
});
});
</script>
con un effetto all'avvicinamento del mouse.
Credo che e.page sia una buona soluzione anche se manca la variabile X
.
In ogni modo non capisco perchè non funzioni...
Codice PHP:
<!--<script type="text/javascript" >
$(document).ready(function() {
$(document).mousemove(function(e) {
if(e.pageY> 230)
$('.des').animate({'opacity: 0'+(( e.pageY - 230) / 18)}, 400);
$('.norm').animate({'opacity: 1'+(( e.pageY - 230) / 18)}, 400);
else
$('.des').animate({'opacity: 1'+(( e.pageY - 230) / 18)}, 400);
$('.norm').animate({'opacity: 0'+(( e.pageY - 230) / 18)}, 400);
});
});
</script>-->
Mi potreste dire dove sta l'errore?
grazie mille in anticipo!