Skip to content

Instantly share code, notes, and snippets.

@riddla
Last active December 11, 2015 11:38
Show Gist options
  • Save riddla/4595007 to your computer and use it in GitHub Desktop.
Save riddla/4595007 to your computer and use it in GitHub Desktop.
// conditional hiding/showing made ...
if (chapterTitleHasVisibleFollowingNotes) {
$chapterTitle.show();
} else {
$chapterTitle.hide();
}
// ... simple
$chapterTitle.toggle(chapterTitleHasVisibleFollowingNotes);
// also see http://jsperf.com/jquery-toggle-vs-conditional-show-hide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment