diff options
author | Jed Foster <jed@jedfoster.com> | 2013-09-21 23:39:31 -0700 |
---|---|---|
committer | Jed Foster <jed@jedfoster.com> | 2013-09-21 23:39:31 -0700 |
commit | 69d6fdcc0ab0003455cdccaa2fa366ae61d4e250 (patch) | |
tree | 16b085477df00a28e9f9b78dfc9cf54b27038c6a | |
parent | 6d7ebaf97e3956642eedd6f3fa68f57db2f35c4a (diff) | |
download | Readmore.js-69d6fdcc0ab0003455cdccaa2fa366ae61d4e250.zip Readmore.js-69d6fdcc0ab0003455cdccaa2fa366ae61d4e250.tar.gz Readmore.js-69d6fdcc0ab0003455cdccaa2fa366ae61d4e250.tar.bz2 |
Invoke Readmore on the info section in the demo, as it's gotten rather long
-rw-r--r-- | demo.html | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -16,7 +16,7 @@ code { color: #777; font-family: "Source Code Pro", "Menlo", "Courier New", monospace;} a { color: #178DB1; } .container { margin: 0 auto; max-width: 960px; } - #info { border-bottom: 1px solid #999; } + #info + .readmore-js-toggle { padding-bottom: 1.5em; border-bottom: 1px solid #999; font-weight: bold;} #demo { padding: 0 10%; } </style> </head> @@ -149,6 +149,16 @@ <script src="readmore.js"></script> <script> + $('#info').readmore({ + moreLink: '<a href="#">More examples and options</a>', + maxHeight: 390, + afterToggle: function(trigger, element, more) { + if(! more) { // The "Close" link was clicked + $('html, body').animate( { scrollTop: element.offset().top }, {duration: 100 } ); + } + } + }); + $('article').readmore({maxHeight: 240}); </script> </body> |