Javascript Positioning?

Have a workspace:
#joystick {
 width: 726px;
 height: 346px;

there is a picture 320x180
it is necessary to drag in the space joystick
Positioning is the center with coordinates x and at the center is (0;0)
when to move to the top left corner coordinates should be: -5;-5
the upper-right corner is 0.5;-0.5
sketched the following code:
don't understand how to make joystick equal to 1? what would the coordinates in the center was 0;0 and the upper angle is 0.5;-0.5
July 12th 19 at 17:05
1 answer
July 12th 19 at 17:07
Whether skis do not go, whether the question is strangely posed.
You decide what you need.
Center - 0.
Values range sizes. Ie from 0 to width/height. Given that the center is 0, Your varinat from (-0.5 and 0.5) * height or width.
Want to play with the size? Well, just divide all the dimensions of the block.

Find more questions by tags AJAXHTMLJavaScriptjQuery