有什么方法可以一次将多个变量传递给Jquery.droppable函数,而不是只使用相同的函数减速两次但名称不同?
或者这不能正常工作?
类似
var $Monday = $( "#Monday" );
var $Tuesday = $( "#Tuesday" );
$Monday.droppable, $Tuesday.droppable({
accept: "#gallery > li",
activeClass: "ui-state-highlight",
drop: function( event, ui ) {
}
而不是
$Monday.droppable({
accept: "#gallery > li",
activeClass: "ui-state-highlight",
drop: function( event, ui ) {
}
$Tuesday.droppable({
accept: "#gallery > li",
activeClass: "ui-state-highlight",
drop: function( event, ui ) {
}
答案 0 :(得分:2)
看看.add()
$Monday.add($Tuesday).doStuff(...)