本文介绍了如何抓取和拖动元素围绕一个圆?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 到目前为止,我有一个带有标记的圈子。 http://jsfiddle.net/x5APH/1/ 我想抓住并将标记拖曳到圆圈周围,但目前的功能 我可以对代码进行哪些更改,以便在按住鼠标时可以围绕圆圈拖动标记? 请注意 如果您可以更新您的解决方案 解决方案 c $ c> $(document).ready(function(){ $('#marker')。on('mousedown',function(){ $('body' ).on('mousemove',function(event){ rotateAnnotationCropper($('#innerCircle')。parent(),event.pageX,event.pageY,$('#marker')); }); }); }); 也可以添加此代码 $('body')。on('mouseup',function(event){$('body')。unbind('mousemove')});在函数 中的 jsfiddle http://jsfiddle.net/sandeeprajoria/x5APH/11/ So far I have a circle with a marker.http://jsfiddle.net/x5APH/1/I would like to grab and drag the marker around the circle, however the current functionality only nudges the marker when you click it.What changes can I make to the code so that the marker can be dragged around the circle while the mouse is held down?NoteIf you could update the fiddle with your solution I would greatly appreciate it. 解决方案 changed some code $(document).ready(function(){ $('#marker').on('mousedown', function(){ $('body').on('mousemove', function(event){ rotateAnnotationCropper($('#innerCircle').parent(), event.pageX,event.pageY, $('#marker')); }); }); }); also add this code $('body').on('mouseup', function(event){ $('body').unbind('mousemove')});in the functionthis is the jsfiddle http://jsfiddle.net/sandeeprajoria/x5APH/11/ 这篇关于如何抓取和拖动元素围绕一个圆?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 07-24 20:20