you should look into jQuery UI draggable, you can confine it to an area and add a grid too if you want locking style sliding. I just had to do this on a project.
it has hover, drag, start, stop methods built in, wont need to do what you are doing here with .click
maybe elaborate more on what you are trying to do.