Your code is working.I have put it on below mentioned link.Check that.
http://jsfiddle.net/dLLrt/[
^]
UPDATE
You may try something is as below.
$("ul").mouseover(function() {
keepGoing = false;
}).mouseout(function() {
keepGoing = true;
});
UPDATE 2
Try my final Update:
$("ul").hover(function () {
keepGoing = false;
test();
}, function () {
keepGoing = true;
test();
});