It sounds like what you’re trying to achieve is “Sticky position”. Here’s a quick resource to point you in the right direction - Editor X: Setting an Element's Position to Pinned or Sticky | Help Center | Wix.com
I’d also recommend checking out the EditorX 101 course to get you going with EditorX - https://www.editorx.com/academy/courses/editor-x-101-course
Good luck!