图像的圆圈并根据鼠标滚轮旋转它们 - Javascript
我想构建一个功能,让用户使用鼠标旋转圆轮并选择图像。我怎样才能建立这样的东西?有没有可用的插件?
I would like to build a functionality to let the user rotate the circle wheel using mouse and select an image. How can i build something like this? is there any plugin available for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可以通过以下方式实现。
1)创建一个Parent div并添加更大的圆圈作为背景。
2)添加小圆圈作为子元素并按照提及的方式排列圆圈,您需要应用旋转和平移CSS属性。 参考 链接 仅用于此目的
3) 然后在Parent DIV中添加鼠标悬停、鼠标按下、鼠标弹起事件。鼠标按下时应用旋转和平移 CSS 属性。请参阅 链接请注意,您将无法在桌面浏览器上测试给定的链接,因为代码具有触摸事件,需要将触摸事件转换为鼠标事件才能实现相同的目的,但是这段代码可以在 iPhone 上测试。
This can achieved by following ways.
1) create a Parent div and add Bigger circle as a background.
2) Add Small Circles as child element and to arrange the circle as mention , you need to apply rotate and translate CSS property. Refer link for this purpose only
3) Then add event mouse over, mouse down and mouse up event to Parent DIV. Apply rotate and translate CSS property on mouse down.For this Refer link Pls note that you will not be able to test the given link on desktop browser as the code is having TOUCH EVENTS, need to convert touch events to Mouse event to achieve the same but this code could be tested on iphone.