【问题标题】:How can i capture the value from a check in and check out <li>?如何从签入和签出 <li> 中获取价值?
【发布时间】:2011-12-20 16:53:36
【问题描述】:

如何从签入和签出&lt;li&gt; 中获取价值?我已经有很多&lt;ol&gt;&lt;li&gt;,正如你在这张图片中看到的那样: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 ) );
                });
            }
        });
    });

然后很多&lt;li&gt;

<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


    【解决方案1】:

    看看这个:https://github.com/tomasdev/jQuery-Scheduler/blob/master/index.html#L92

    基本上我们的想法是我们的​​网格是固定宽度的,然后您可以计算知道该宽度的天数/单元格。然后你只需要算出月份,并将“本月的这一天”保存为开始,将“该月的那一天”保存为结束边缘。

    如果不够清楚,我会进一步解释。

    【讨论】:

      猜你喜欢
      • 2016-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多