Skip to content

Instantly share code, notes, and snippets.

@iansheridan
Created December 22, 2009 21:38
Show Gist options
  • Save iansheridan/262078 to your computer and use it in GitHub Desktop.
Save iansheridan/262078 to your computer and use it in GitHub Desktop.
$('#image-select-all').click(function() {
$('#image-grid .image').each(function(){
$(this).trigger('selected');
});
console.log("clicked > image-select-all to trigger > click.selected")
console.log($('#image-grid .image'))
});
$('#image-select-none').click(function() {
$('#image-grid .image').each(function(){
$(this).trigger('unselected');
});
console.log("clicked > image-select-none to trigger > click.unselected")
console.log($('#image-grid .image'))
});
$('#image-select-reverse').click(function() {
$theselected = $('#image-grid .ui-selected');
$theunselected = $('#image-grid .ui-selectee').not('.ui-selected');
$theselected.each(function(){
$(this).trigger('unselected');
});
$theunselected.each(function(){
$(this).trigger('selected');
});
console.log("clicked > image-select-reverse to trigger > click.unselected and click.selected")
console.log([$theselected,$theunselected])
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment