title: Detect the percentage of the horizontal position that users click on
body: <p>I'm trying to make a slider from scratch like the jQuery UI one but i'm not sure how to detect the horizontal position where the user clicks on the slider.</p>
  
  <p>Example, if i click on <code>foo</code> div in the middle, it'd return 50%. If i have that it would be easy for me to adjust the slider's filler div width accordingly.</p>