Grow your CSS skills. Land your dream job.

e.targ equivalent

  • # August 23, 2009 at 11:08 pm

    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!

    # August 24, 2009 at 4:10 am

    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)

You must be logged in to reply to this topic.

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