help: mouse position for navigation

help: mouse position for navigation

hi everyone,

I'm new to jQuery and know a little about it, could someone help how i can achieve this in jQuery. please see image below

Image

i want the blue arrow to follow the x-position of the cursor whenever i'm inside of the dark gray box. the blue arrow should only move left and right.