Toolip Hover and Viewport

I’ve been following this guide on how to create a tooltip (https://webflow.com/blog/how-to-build-tooltips). I was wondering if there was any native way in webflow to have it detect viewports so that a hover action will stay within the viewport. If not, I assume I can write some custom jquery and achieve this?