title: Detect when element is dragged near the sides of the window and perform function
body: <p>I'm using jQuery UI's <code>draggable</code> method to drag a panel around the screen. I want to be able to replicate a function in Photoshop, where you can drag a panel near the edge of the screen and it will display a glowing bar along the edge to indicate that it will attach there (while hovering over it in the mouse down state), and when you drop the panel it transforms in to a full-height sticky panel that is attached to the edge you dropped it on.</p>
  
  <p>Can anyone help achieve this in HTML/JS?</p>
  
  <p>If someone can just help me detect when I'm say within 10px of the right side of the screen <em>while in the drag/<code>start</code> state</em>, I can probably handle the rest.</p>