好的,所以我正在尝试集成可选的jQuery UI插件(网格),我喜欢它如何将选定的索引发布回来。这是我想做的事情:
$(function() {
$( "#selectable" ).selectable({
stop: function() {
var result = $( "#select-result" ).empty();
$( ".ui-selected").each(function() {
var index = $( "#selectable li" ).attr('id');
// But I want the ids of all the selected elements,
// but the id of the first is just getting copied on my site!
result.append( "#" + ( index + 1 ) );
});
}
});
});