Skip to content

Instantly share code, notes, and snippets.

@alf239
Created November 8, 2011 23:26
Show Gist options
  • Save alf239/1349677 to your computer and use it in GitHub Desktop.
Save alf239/1349677 to your computer and use it in GitHub Desktop.
Autohider in JS
$.each(
$.grep(
$(".l_expandcomments"),
function(e) {
var m = /(\d+) more comments/.exec(e.innerHTML);
return m && parseInt(m[1]) > 10;
}),
function() {
$(".l_hideone", $(this).parents(".l_entry"))
.click();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment