Forums

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

Home Forums JavaScript e.targ equivalent

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

    Yooyoyoyoyo I’ve found jQuery pretty useful but I’m having a problem with mouse positions on target elements.

    http://affluentpracticemarketing.com/ti … stween.php

    On that menu for instance, if you try to bring the mouse onto the dropdown menu "slideUp" event triggers and the drop down goes away. How do you achieve this?

    Code:
    $(document).ready(function () {
    $(‘a.home’).mouseover(function () {
    $(‘ul.menu_body’).slideDown(‘medium’);
    });

    $(‘a.home’).mouseout(function () {
    $(‘ul.menu_body’).slideUp(‘medium’);
    });
    });

    I basically want to be able to do something like:

    Code:
    if(e.targ != dropdown) {
    run the slideUp function
    }

    Unless there’s an easier way

    Thanks!

    #62627
    Mr KiTT3N
    Member

    Change

    to

    if its nested then you can do something like

    Code:
    $(‘#menu li).hover(function(){
    $(this, ‘ul’).slideDown(500);
    },function(){
    $(this, ‘ul’).slideUp(500);
    });

    Its defiantly not tested… but you should get the idea

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.