diff options
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | demo.html | 1 | ||||
-rw-r--r-- | readmore.js | 3 |
3 files changed, 4 insertions, 1 deletions
@@ -22,6 +22,7 @@ Yes, it's that simple. You can change the speed of the animation, the height of * `maxHeight: 200` (in pixels) * `moreLink: '<a href="#">Read more</a>'` * `lessLink: '<a href="#">Close</a>'` +* `sectionCSS: 'display: block; width: 100%;'` (sets the styling of the blocks) * `beforeToggle: function() {}` (called after a more or less link is clicked, but *before* the block is collapsed or expanded) * `afterToggle: function() {}` (called *after* the block is collapsed or expanded) @@ -51,6 +51,7 @@ <li><code>maxHeight: 200</code> (in pixels)</li> <li><code>moreLink: '<a href="#">Read more</a>'</code></li> <li><code>lessLink: '<a href="#">Close</a>'</code></li> + <li><code>sectionCSS: 'display: block; width: 100%;'</code> (sets the styling of the blocks)</li> <li><code>beforeToggle: function() {}</code> (called after a more or less link is clicked, but <i>before</i> the block is collapsed or expanded)</li> <li><code>afterToggle: function() {}</code> (called <i>after</i> the block is collapsed or expanded)</li> </ul> diff --git a/readmore.js b/readmore.js index 20fc294..c8d6873 100644 --- a/readmore.js +++ b/readmore.js @@ -13,6 +13,7 @@ maxHeight: 200, moreLink: '<a href="#">Read More</a>', lessLink: '<a href="#">Close</a>', + sectionCSS: 'display: block; width: 100%;', // callbacks beforeToggle: function(){}, @@ -28,7 +29,7 @@ delete(this.options.maxHeight); - var styles = '.readmore-js-toggle, .readmore-js-section { display: block; width: 100%; } .readmore-js-section { overflow: hidden; }'; + var styles = '.readmore-js-toggle, .readmore-js-section { ' + this.options.sectionCSS + ' } .readmore-js-section { overflow: hidden; }'; (function(d,u) { var css=d.createElement('style'); |