treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Problem with Hover...

  • See CodePen:

    When you hover over the "FB" link at right of bar a window opens, but as soon as cursor moves off of "FB" link the window closes.

    How can I keep window open as long as cursor is hovering over the window so users can select links from inside of open window?

    Thank you, C

  • You would need some form of JavaScript or jQuery to keep it open after hover. The idea of it would be to make a class called active and add that class to your div when someone hovers over the FB link.

    Here's some jQuery I wrote for a slider that you should be able to re-work to fit this situation :)

    var sliderActive = $("#wrapper #slider-single");
    
    sliderActive.not(":first").removeClass("active");
    
    sliderActive.on("hover", function() {
      sliderActive.removeClass("active");
      $(this).addClass("active");
    });
    
  • Problem solved. Thank you for the help. It got me on the right track.