将可排序对象悬停在可放置对象上时添加突出显示动画 JQUERY
我有一个可排序的称为项目的对象列表,以及一个可删除的称为类别的对象列表。我需要以某种方式做到这一点,以便当您单击可排序的项目并将其向下拖动使其悬停在可放置的类别上时,项目将进入的类别会突出显示,或概述或某种其他类型的动画。
我确信它可以通过像 add-class-on-hover-over-droppable-object 类型函数这样简单的东西来完成,但我不知道应该如何设置它。
查看一些 jQuery 文档,我发现对于可放置对象,您可以设置 over: function(),
属性,但我无法让它工作......
怎么办我需要做什么才能使这项工作成功?
I have a list of objects called projects that are sortable, and a list of objects called categories that are droppable. I need to somehow make it so that when you click on a sortable project, and drag it down so it is hovering over a droppable category, the category that the project is going to go into is highlighted, or outlined or some other kind of animation.
I am sure that it could be done by something as simple as an add-class-on-hover-over-droppable-object type function, but I don't know how it is supposed to be setup.
Looking through some of the jQuery documentation, I found out that for a droppable object, you can set an over: function(),
attribute, but I couldn't get it to work...
What do I need to do to make this work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
hoverClass
选项。 jQuery droppable 的演示之一 使用它(单击查看源代码
查看它是如何工作的)。Use the
hoverClass
option. One of the demos for jQuery droppable uses it (click onview source
to view how it works).