Js to trigger submenu on correct position