summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJed Foster <jed@jedfoster.com>2014-02-09 12:57:21 -0800
committerJed Foster <jed@jedfoster.com>2014-02-09 12:57:21 -0800
commit62a1a1c881f55f970fb6c39bb456f601b41a8748 (patch)
treeeb5180ce3271f4e712d58d740831c2479be11486
parente087699588bc02b35167c86bffa7f7c8f2d37dbc (diff)
downloadReadmore.js-62a1a1c881f55f970fb6c39bb456f601b41a8748.zip
Readmore.js-62a1a1c881f55f970fb6c39bb456f601b41a8748.tar.gz
Readmore.js-62a1a1c881f55f970fb6c39bb456f601b41a8748.tar.bz2
Document the new destroy method
-rw-r--r--README.md16
-rw-r--r--demo.html11
2 files changed, 25 insertions, 2 deletions
diff --git a/README.md b/README.md
index 325c663..8bbd164 100644
--- a/README.md
+++ b/README.md
@@ -81,4 +81,18 @@ If you want to include the necessary styling in your site's stylesheet, you can
```javascript
$('article').readmore({embedCSS: false});
-``` \ No newline at end of file
+```
+
+## Removing Readmore
+
+You can remove the Readmore functionality like so:
+
+```javascript
+$('article').readmore('destroy');
+```
+
+Or, you can be more surgical by specifying a particular element:
+
+```javascript
+$('article:first').readmore('destroy');
+```
diff --git a/demo.html b/demo.html
index 948b369..26867dc 100644
--- a/demo.html
+++ b/demo.html
@@ -81,7 +81,7 @@
<p>Here's an example of how you could use the <code>afterToggle</code> callback to scroll back to the top of a block when the "Close" link is clicked.</p>
- <pre><code>$('article').readmore({
+ <pre><code class="javascript">$('article').readmore({
afterToggle: function(trigger, element, more) {
if(! more) { // The "Close" link was clicked
$('html, body').animate( { scrollTop: element.offset().top }, {duration: 100 } );
@@ -111,6 +111,15 @@
<pre><code class="javascript">$(&apos;article&apos;).readmore({embedCSS: false});</code></pre>
+ <h2 id="removingreadmore">Removing Readmore</h2>
+
+ <p>You can remove the Readmore functionality like so:</p>
+
+ <pre><code class="javascript">$('article').readmore('destroy');</code></pre>
+
+ <p>Or, you can be more surgical by specifying a particular element:</p>
+
+ <pre><code class="javascript">$('article:first').readmore('destroy');</code></pre>
</section>
<h1>Demo</h1>