diff options
-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> |