Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2014
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    on hover fade out img

    Hello,

    I have a question ...

    I have a css slideshow (you might be puking already!) that is basically a small div with a span in it containing an image and caption. The span is hidden, then when it is hovered over, the span is positioned absolutely and displayed.

    My question is, how do I set some javascript so that when it is hovered over, the span will slowly fade out (so that another thumbnail can be clicked on). This is especially an issue on smartphones where the hover state seems to stay active.

    I've tried this ... (#exhaust is the id of the div with the image and caption in it)

    $( "#exhaust" ).hover(function() {
    $( "#exhaust.img" ).fadeOut( 3000 );
    });

    But it doesnt work.

    Many thanks,
    Greg

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,677
    Thanks
    6
    Thanked 1,008 Times in 981 Posts
    Yeah, you need a whitespace between #exhaust and .img, otherwise it will look for an element that has the ID “exhaust” and the class “img”.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •