mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-05 21:38:45 +08:00
26 lines
577 B
JavaScript
Executable File
26 lines
577 B
JavaScript
Executable File
$(function()
|
|
{
|
|
/**
|
|
* 全选/取消
|
|
*/
|
|
$('.node-choice').on('click', function()
|
|
{
|
|
var state = $(this).is(':checked');
|
|
$(this).parents('li').next('.list-find').find('input[type="checkbox"]').each(function()
|
|
{
|
|
this.checked = state;
|
|
});
|
|
});
|
|
|
|
/**
|
|
* 子元素选择/取消操作
|
|
*/
|
|
$('.list-find input[type="checkbox"]').on('click', function()
|
|
{
|
|
var state = ($(this).parents('.list-find').find('input[type="checkbox"]:checked').length > 0);
|
|
$(this).parents('ul').prev().find('label input').each(function()
|
|
{
|
|
this.checked = state;
|
|
});
|
|
});
|
|
}); |