diff options
author | Jed Foster <jed@jedfoster.com> | 2014-02-09 12:57:21 -0800 |
---|---|---|
committer | Jed Foster <jed@jedfoster.com> | 2014-02-09 12:57:21 -0800 |
commit | 62a1a1c881f55f970fb6c39bb456f601b41a8748 (patch) | |
tree | eb5180ce3271f4e712d58d740831c2479be11486 | |
parent | e087699588bc02b35167c86bffa7f7c8f2d37dbc (diff) | |
download | Readmore.js-62a1a1c881f55f970fb6c39bb456f601b41a8748.zip Readmore.js-62a1a1c881f55f970fb6c39bb456f601b41a8748.tar.gz Readmore.js-62a1a1c881f55f970fb6c39bb456f601b41a8748.tar.bz2 |
Document the new destroy method
-rw-r--r-- | README.md | 16 | ||||
-rw-r--r-- | demo.html | 11 |
2 files changed, 25 insertions, 2 deletions
@@ -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'); +``` @@ -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">$('article').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> |