jqueryを選択可能にして1時間の計画を立てています。
アイデアは単純です。複数選択が可能です。クリックすると、時間のオン/オフが切り替わります。Shift キーを押すと、フィールドが赤くなり、破壊されます。
コード:
$(function() {
$("#selectable").bind("mousedown", function(event) {
event.metaKey = true;
}).selectable({
selecting: function() {
$(this).find('td.ui-selecting').addClass('potential');
if (event.shiftKey == 1) {
$(this).find('td.ui-selecting').addClass('destroy');
}
},
stop: function() {
$(this).find('td.ui-selected.destroy').removeClass('ui-selected potential');
$(this).find('td.ui-selected.potential').removeClass('potential');
$(this).find('td.destroy').removeClass('destroy');
}
});
$("td.ui-state-default").click(function() {
$(this).toggleClass('ui-selected');
});
});
実際の例を参照してください: http://studentify-static-pages.s3.amazonaws.com/calendar.html
今。単純なクリックが正しくできないようです。おそらく、以前にバインドしているからです。望ましい動作: 単純なクリック (つまり 0 なげなわ) で ui-select を切り替えます。
ヒントはありますか?ありがとう。