Grow your CSS skills. Land your dream job.

[Solved] Propagation issue

  • # May 19, 2010 at 1:03 pm

    I have an unordered list of images that when you hover over them an enlarge icon appears on the link (the image is the background of the list-item). The problem is that I have a drop-down, and when I hover over part of the drop-down that appears over the image, the drop-down disappears so I know I have some kind of propagation problem. Any ideas?

    Code:
    $(document).ready(function() {
    var $art = $(‘#artwork li a’);
    $art.css(‘opacity’, 0);
    $art.hover(
    function() {
    $(this).stop().animate({
    opacity: 1,
    },150);
    },
    function() {
    $(this).stop().animate({
    opacity: 0,
    },400);
    }
    );
    # May 19, 2010 at 3:26 pm

    I added:

    Code:
    $(‘.drop-down’).hover(function(event) {
    event.stopPropagation();
    });

    after my code. Didn’t even need to make it a call back. My first attempt was trying to add the event.stopPropagation to the list-items when I should have just tossed it on the drop down.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".