diff options
author | neilmonroe <neil.monroe@gmail.com> | 2009-03-20 14:30:29 -0700 |
---|---|---|
committer | neilmonroe <neil.monroe@gmail.com> | 2009-03-20 14:30:29 -0700 |
commit | 465a6a365b0254ef4ee06e329881a14f791c12c4 (patch) | |
tree | 7e9cab95f8ebf10ad8d35af2161ec0d82e3f4258 | |
parent | 00e7013ba49f652f6cfaeb10a437f5220dbfefc6 (diff) | |
download | jquery-countable-465a6a365b0254ef4ee06e329881a14f791c12c4.zip jquery-countable-465a6a365b0254ef4ee06e329881a14f791c12c4.tar.gz jquery-countable-465a6a365b0254ef4ee06e329881a14f791c12c4.tar.bz2 |
Corrected the github code styling for the example code.
-rw-r--r-- | README.markdown | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown index 4f194ed..aba97a6 100644 --- a/README.markdown +++ b/README.markdown @@ -23,12 +23,17 @@ The countable plugin has 11 settings: ## Examples Add counter to all textarea objects on the page using defaults: +{ $("textarea").countable(); +} Add counters to a specific set of text fields, before each element: +{ $("#myTextBox, textarea.info").countable({ appendMethod: "insertBefore" }); +} Add counter to a specific textarea, but display in a given container element (with other advanced options): +{ $("#comments").each(function() { $(this).countable({ threshold: .75, @@ -41,6 +46,7 @@ Add counter to a specific textarea, but display in a given container element (wi fadeDuration: 0 }) }); +} Note: In the last example, the code is wrapped in an 'each' function call to get 'this' to point to the text element. Also, 'maxLength' is being pulled from contextual information using the metadata jQuery plugin (http://plugins.jquery.com/project/metadata). |