Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Add fade in to this function…problem

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #145557
    Rugg
    Participant

    Hi…

    The following code snippet is used for swapping images during a hover event. The code functions as intended…but I’m trying to add a fadeIn/fadeOut transition during the hover event. I’ve attempted to accomplish this by using CSS3 transitions…but would prefer to stick with jquery. If anyone could suggest a method for doing this…I would much appreciate it. Thanks.

    Code:

    $('img').hover(function () {
    
        $(this).attr({
    
            src: $(this).attr('data-src'), 'data-src': $(this).attr('src')
    
        });     
    
    }); 
    
Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.