You can use bind
to reuse this
:
timeoutId = window.setTimeout(function() {
timeoutId = null;
jQuery(this).children('ul').delay(20).slideDown(200);
}.bind(this), 500);
Alternatively, you can save the this
reference into a variable outside the scope :
if (!timeoutId) {
var $this = $(this);
timeoutId = window.setTimeout(function() {
timeoutId = null;
$this.children('ul').delay(20).slideDown(200);
}, 500);
}