Is there a way to fix the offset of the menu because when I

Is there a way to fix the offset of the menu because
when I click on the tree item, the menu appears maybe 10 pixels lower than the
cursor.

There is no public API for such
functionality, but you can adjust dhtmlxmenu_cp.js manually. 

Line 171:

var verCor = -14;