开发者

Web Programming -> coordinate system

I ne开发者_StackOverflow社区ed something like coordinate system that could be used on every image. And user can move objects in coordinate system and coordinates will be entered in text area. I'm not sure but I think JavaScript should be used.


It sounds like you want something like jQuery UI's .draggable feature.

Through it you can let the user drag an object on the screen, access where it is, when it's stopped being moved, and so on. You can also drag according to ('snap' to) a grid.


Check the jQuery reference - you can lock the drag-area to a div or (almost) any other element. Check the containment option.

Some code example from jQuery site:

// Initialize a draggable with the containment option specified.
$(".selector").draggable({ containment: 'parent' });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜