【发布时间】:2012-11-20 03:53:24
【问题描述】:
我正在阅读这段代码 (http://jqueryui.com/droppable/#photo-manager), 但无法理解某一特定行
var $gallery = $( "#gallery" ),
$trash = $( "#trash" );
$( "li", $gallery ).draggable({ //This is the line a I can't understand well
cancel: "a.ui-icon",
revert: "invalid",
containment: "document",
helper: "clone",
cursor: "move"
});
为什么 $gallery 在那里?它不会使 $gallery 可拖动,只有 <li> 是可拖动的。
似乎只有#gallery中的<li>可以拖动,但使用$("#gallery li")或$("#gallery > li")很容易做到这一点
那么有什么不同呢?
【问题讨论】:
标签: jquery jquery-ui draggable