Skip to content

Instantly share code, notes, and snippets.

@gtarsia
Last active August 29, 2015 14:18
Show Gist options
  • Save gtarsia/f139cb4e452d9d12b8f5 to your computer and use it in GitHub Desktop.
Save gtarsia/f139cb4e452d9d12b8f5 to your computer and use it in GitHub Desktop.
Hide reddit comments by click the side of the comment
function hide(obj) {
$(obj)
.children('.entry').first()
.children('.tagline').first()
.children('.expand').first()
.click();
}
var shouldClick = true;
var preventClickEvent = false;
$(document).ready(function() {
$(".comment").click(function(e) {
try {
if (!shouldClick) return;
if (e.currentTarget != e.target) return;
hide(this);
e.preventDefault();
shouldClick = false;
setTimeout(function() { shouldClick = true; }, 200);
} catch(err) {}
});
});
@gtarsia
Copy link
Author

gtarsia commented Apr 9, 2015

It would be nice to have color on hover only for the side of the comment and nothing else, but I really have no idea how to do that, because there is no element to color there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment