summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorneilmonroe <neil.monroe@gmail.com>2009-03-20 14:58:48 -0700
committerneilmonroe <neil.monroe@gmail.com>2009-03-20 14:58:48 -0700
commitd556e8ea2ca5cd159ffaf279a3f6052553264732 (patch)
tree838673d4e5ed9f18384580ce10f3a1b5c7d19242
parent9b32d58bbdd82f8e00867a7d892a977f09448cac (diff)
downloadjquery-countable-d556e8ea2ca5cd159ffaf279a3f6052553264732.zip
jquery-countable-d556e8ea2ca5cd159ffaf279a3f6052553264732.tar.gz
jquery-countable-d556e8ea2ca5cd159ffaf279a3f6052553264732.tar.bz2
Update markdown formatting (again).
-rw-r--r--README.markdown32
1 files changed, 16 insertions, 16 deletions
diff --git a/README.markdown b/README.markdown
index 8e058f1..1026dff 100644
--- a/README.markdown
+++ b/README.markdown
@@ -23,26 +23,26 @@ The countable plugin has 12 settings:
## Examples
Add counter to all textarea objects on the page using defaults:
-``$("textarea").countable();``
+ $("textarea").countable();
Add counters to a specific set of text fields, before each element:
-``$("#myTextBox, textarea.info").countable({ appendMethod: "insertBefore" });``
+ $("#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,
- appendMethod: "appendTo",
- target: $(this).parent().find("label small"),
- startOpacity: 1,
- maxLength: $(this).metadata().maxLength,
- positiveCopy: " ({n} characters left)",
- negativeCopy: " ({n} characters over the limit)",
- 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>)._
+ $("#comments").each(function() {
+ $(this).countable({
+ threshold: .75,
+ appendMethod: "appendTo",
+ target: $(this).parent().find("label small"),
+ startOpacity: 1,
+ maxLength: $(this).metadata().maxLength,
+ positiveCopy: " ({n} characters left)",
+ negativeCopy: " ({n} characters over the limit)",
+ 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>)._
## License