Forums

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

Home Forums JavaScript [Solved] Propagation issue

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #29094
    noahgelman
    Participant

    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);
    }
    );
    #76024
    noahgelman
    Participant

    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)
  • The forum ‘JavaScript’ is closed to new topics and replies.