macieQ82
10-14-2011, 08:32 AM
1) Script Title: jQuery Drop Line Menu
2) Script URL (on DD): Script URL (http://www.dynamicdrive.com/style/csslibrary/item/jquery_drop_line_menu/)
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:
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:
$targetul.dequeue().slideDown(droplinemenu.animateduration.over)
Into this:
$targetul.stop(false, true).slideDown(droplinemenu.animateduration.over)
And this line:
$targetul.dequeue().slideUp(droplinemenu.animateduration.out)
Into this:
$targetul.stop(false, true).slideUp(droplinemenu.animateduration.out)
I hope it's helpfull for You.
2) Script URL (on DD): Script URL (http://www.dynamicdrive.com/style/csslibrary/item/jquery_drop_line_menu/)
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:
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:
$targetul.dequeue().slideDown(droplinemenu.animateduration.over)
Into this:
$targetul.stop(false, true).slideDown(droplinemenu.animateduration.over)
And this line:
$targetul.dequeue().slideUp(droplinemenu.animateduration.out)
Into this:
$targetul.stop(false, true).slideUp(droplinemenu.animateduration.out)
I hope it's helpfull for You.