
11/12/2011, 18:39
|
 | | | Fecha de Ingreso: abril-2011
Mensajes: 331
Antigüedad: 13 años, 10 meses Puntos: 9 | |
Respuesta: Fade in/Fade out Si existe!
Para cuando pasas el mouse se acciona el siguiente evento: Cita: var $this = $(this);
var fade = $('> .hover', $this);
if (fade.is(':animated')) {
fade.stop().fadeTo(500, 1);
} else {
fade.fadeIn(500);
} Cuando saco el mouse Cita: var $this = $(this);
var fade = $('> .hover', $this);
if (fade.is(':animated')) {
fade.stop().fadeTo(500, 0);
} else {
fade.fadeOut(500);
}
El codigo completo es: Cita: $(document).ready(function() {
// find the div.fade elements and hook the hover event
$('.fadeThis').hover(function() {
// on hovering over find the element we want to fade *up*
var fade = $('> .hover', this);
// if the element is currently being animated (to fadeOut)...
if (fade.is(':animated')) {
// ...stop the current animation, and fade it to 1 from current position
fade.stop().fadeTo(500, 1);
} else {
fade.fadeIn(500);
}
}, function () {
var fade = $('> .hover', this);
if (fade.is(':animated')) {
fade.stop().fadeTo(500, 0);
} else {
fade.fadeOut(500);
}
});
}
__________________ Los mejores juegos de PC gratis en ******
Última edición por hackcrack; 16/12/2011 a las 22:19 |