带有多个句柄的jQuery Draggable [英] Jquery Draggable with more than one handle
本文介绍了带有多个句柄的jQuery Draggable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可能有一个带有多个句柄的draggable
元素?
Is it possible to have a draggable
element with more than one handle?
我将其初始化两次,每次使用不同的句柄参数,但是它不起作用-仅第一个起作用.
I am initializing it twice, each time with a different handle param, but it doesn't work - only the first one works.
推荐答案
您只应传递一次"handle"参数,它可以是选择器或元素.
You should only pass the 'handle' param once, and it can either be a selector or an elements(/s).
因此,要使其与多个手柄一起使用:
So, to make it work with more than one handle:
$(elem).draggable({
handle: '#handle1, #handle2',
});
更多信息/来源: http://docs.jquery.com/UI/Draggables/draggable
这篇关于带有多个句柄的jQuery Draggable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文