Results 1 to 3 of 3

Thread: Small fix for jQuery Drop Line Menu

  1. #1
    Join Date
    Oct 2011
    Posts
    6
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default Small fix for jQuery Drop Line Menu

    1) Script Title: jQuery Drop Line Menu

    2) Script URL (on DD): Script URL

    3) Describe problem: When You move mouse very fast betwen 2 menu elements submenu will disapear after some time or height of sub menu will be to small to display whole submenu.

    EXPLANATION:

    Problem comes from jQuery dequeue() function withc is used before each animation efect (on mouse hover). According to documentation, dequeue() function remove next function (in this script prevoius unfinished annimation) from queue. Because of that when animation is not finished dequeue function stops that animation for e.g. in the middle. Height of submenu element in the middle of animation is only helf. For next repat of that animation targeted height is not a full height but that half. After few fast moves of mouse over menu elements that height can be redused to 0. To avoid this problem You should use jQuery stop() function with arguments like this:
    Code:
    stop(false, true)
    False says not to dequeue.
    True says immediately finish (jump to end) previous function (in our case annimation).
    For our script it means that height always will be full height.

    FIX:

    To applay that fix You have to change this line:
    Code:
    $targetul.dequeue().slideDown(droplinemenu.animateduration.over)
    Into this:
    Code:
    $targetul.stop(false, true).slideDown(droplinemenu.animateduration.over)
    And this line:
    Code:
    $targetul.dequeue().slideUp(droplinemenu.animateduration.out)
    Into this:
    Code:
    $targetul.stop(false, true).slideUp(droplinemenu.animateduration.out)
    I hope it's helpfull for You.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Thanks for the tip- I seem to recall however that usng stop() in the aformentioned config also has its own set of problems, which is why I had switched over to using dequeue() instead. I could be mistaken, however. I could be thinking of another script though. I'll give this a shot later in the weekend.
    DD Admin

  3. #3
    Join Date
    Oct 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you! This is really a helpful fix.
    Kinda surprised that the original script still isn't fixed yet.
    Thanks Macie

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •