Skip to content

Instantly share code, notes, and snippets.

@fubobing126
Created September 14, 2017 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fubobing126/018da0cc57993ccf305ce830306a1a3b to your computer and use it in GitHub Desktop.
Save fubobing126/018da0cc57993ccf305ce830306a1a3b to your computer and use it in GitHub Desktop.
common
//全选的实现
$(".check-all").click(function (e) {
$(this).parents('.table').find('.ids').prop("checked", this.checked);
});
$(".ids").click(function () {
var pel = $(this).parents('.table');
var all = pel.find('.check-all');
if (pel.find('input.ids').not(':checked').length > 0)
all.prop("checked", false);
else
all.prop("checked", true);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment