【发布时间】:2011-12-20 16:53:36
【问题描述】:
如何从签入和签出<li> 中获取价值?我已经有很多<ol> 和<li>,正如你在这张图片中看到的那样:http://s2.subirimagenes.com/otros/previo/thump_7254872hot.jpg
我需要捕获签入值(在图像中,从拖动的橙色线开始)直到您 mousedown(签出),但我只需要签入和签出的值。
对于拖动,我有这样的东西:
$(function() {
$( ".ui-selectable" ).selectable({
options:{
autoRefresh: true,
distance: 40,
disabled:true,
filter: '*',
tolerance: 'touch'
},
stop: function() {
var result = $( "#select-result" ).empty();
$( ".ui-selected", this ).each(function() {
var index = $( "#selectablecls li" ).index( this );
result.append( " #" + ( index + 1 ) );
});
}
});
});
然后很多<li>
<ol id="selectable" class="ui-selectable selectablecls">
<li class="null ui-state-default ui-selectee grdborder _a" style="width:28px" id="2011_11_07_9700000000000006_9700000000000002_a" rel="1" title="" width="28px"></li>
<li class="null ui-state-default ui-selectee grdborder _b" style="width:28px" id="2011_11_07_9700000000000006_9700000000000002_b" rel="2" title="" width="28px">
....
正如你在这张图片中看到的:http://s2.subirimagenes.com/otros/previo/thump_7254872hot.jpg
【问题讨论】:
标签: jquery jquery-ui-selectable