code: function (e, id) {
  	if (!e) {
  		return false;
  	}
  	else {
  		var el = e.target || e.srcElement || e || false;
  		while (el && el.id !== id) {
  			el = el.parentNode || false;
  		}
  		return (el !== false);
  	}
  }
docs: taken from https://github.com/inuyaksa/jquery.nicescroll/blob/master/jquery.nicescroll.js