Add a jquery fadein to this
- Started
- Last post
- 3 Responses
- attentionspan
Its a simple image rollover - anyone know how to add a simple fadein when the other image rolls in? would be grateful
$(function() {
$('.rollover').hover(function() {
var currentImg = $(this).attr('src');
$(this).attr('src', $(this).attr('hover'));
$(this).attr('hover', currentImg);
}, function() {
var currentImg = $(this).attr('src');
$(this).attr('src', $(this).attr('hover'));
$(this).attr('hover', currentImg);
});
});
- WhiteFace0
I'm no jQuery expert but i used this for fading in a div on rollover...
<script>
$(".mouseover").mouseover(functi... {
$(this).find(".fader").animate({
opacity: 1
}, 250, function() {
// Animation complete.
});}).mouseout(function(){
$(this).find(".fader").animate({
opacity: 0
}, 250, function() {
// Animation complete.
});
});</script>
make sure you set opacity to 0 in your style sheet
- fugged0
what's the behavior your looking for?
- meffid0
Get pagefade.js and apply it to any element on a page.
$(document).ready(function() {
$(".fade").css("display", "none");
$(".fade").fadeIn(1000);
$("a.nav").click(function(event...
event.preventDefault();
linkLocation = this.href;
$(".fade").fadeOut(1000, redirectPage);
});function redirectPage() {
window.location = linkLocation;
}});