セクション付きのサイドバーがあり、各セクション内にチャプターがあり、その中にサブチャプターがあります。チャプターとサブチャプターは、チェックボックスを使用して既読としてマークされます。私がやろうとしていることは:
章のチェックボックスをオンにすると、ラベルに線が引かれ、すべてのサブチャプターのチェックボックスも線が引かれます。
チャプターチェックボックスのマークを外すと、ラインスルーが消え、すべてのサブチャプターチェックボックスのマークが外れ、ラインスルーも消えます。
私はこれをしばらくの間機能させるように努めてきましたが、成功しなかった場合は、助けていただければ幸いです。ありがとう。
$(".chapter-ended").live "change", ->
id = $(this).attr("id")
isChecked = $(this).attr("checked")
if(isChecked)
$(this).closest('li').css "text-decoration", "line-through"
else
$(this).closest('li').css "text-decoration", "none"
$(".subchapter-ended").live "change", ->
id = $(this).attr("id")
isChecked = $(this).attr("checked")
if(isChecked)
$(this).closest('li').css "text-decoration", "line-through"
else
$(this).closest('li').css "text-decoration", "none"