Forums

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

Home Forums JavaScript [Solved] Links trigger jquery animation

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27924
    dcp3450
    Participant

    I have an animate on my site that uses a stack of notecards with links on them. When you select the notecard it slides out. I want the user to select the link on the notecard. However, since the links are in the notecard jquery sees the user select the notecard and slides back.

    Basically, how can I tell jquery to ignore the animation when the link is selected

    Code:
    $(‘#sports’).toggle(function()
    {
    $(this).stop().animate({‘marginLeft’:’450px’});
    $(‘#news’).stop().animate({‘marginLeft’:’0px’});
    $(‘#announcements’).stop().animate({‘marginLeft’:’0px’});
    },function()
    {
    $(this).stop().animate({‘marginLeft’:’0px’});
    });
    #70647
    dcp3450
    Participant

    .toggle() uses .preventDefault() which keeps links and buttons from working. I need to turn that off. Any ideas?

    #70648
    dcp3450
    Participant

    Solved

    Code:
    $(‘a’).click(function(event)
    {
    event.stopPropagation();
    });
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.