Skip to content

Instantly share code, notes, and snippets.

@andershaig
Last active December 21, 2015 20:19
Show Gist options
  • Save andershaig/6360305 to your computer and use it in GitHub Desktop.
Save andershaig/6360305 to your computer and use it in GitHub Desktop.

Revisions

  1. andershaig revised this gist Aug 27, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion stories.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    // Hide all stories except for the first X (0-based index - e.g. subtract 1 from the number of answers you want to show)
    // Hide all stories except for the first X
    // (0-based index - e.g. subtract 1 from the number of answers you want to show)
    $('.stories_recent_activity ol li:gt(X)').hide();

    // Examples
  2. andershaig created this gist Aug 27, 2013.
    13 changes: 13 additions & 0 deletions stories.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    // Hide all stories except for the first X (0-based index - e.g. subtract 1 from the number of answers you want to show)
    $('.stories_recent_activity ol li:gt(X)').hide();

    // Examples
    // Show only 1 item
    $(document).ready( function () {
    $('.stories_recent_activity ol li:gt(0)').hide();
    });

    // Show 5 items
    $(document).ready( function () {
    $('.stories_recent_activity ol li:gt(4)').hide();
    });