Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save njm2112/670640196e11681c26661503cb48dd40 to your computer and use it in GitHub Desktop.

Select an option

Save njm2112/670640196e11681c26661503cb48dd40 to your computer and use it in GitHub Desktop.

Revisions

  1. @dansheffler dansheffler renamed this gist Jan 8, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @dansheffler dansheffler created this gist Jan 8, 2016.
    23 changes: 23 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    <script src="/js/jquery-1.8.3.min.js"></script>

    // A little clever jQuery styling of blockquotes
    <script>
    $('blockquote p').each(function(){

    var $numWords = $(this).text().split(" ").length;

    console.log($numWords)

    if ($numWords >= 25) {
    $(this).css("text-align", "left");
    $(this).css("padding-left", "1em");
    }
    else {
    $(this).css("font-size", "1.3em");
    }

    if ($numWords >= 50) {
    $(this).css("font-size", "0.7em");
    }
    });
    </script>