summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJed Foster <jed@jedfoster.com>2013-09-21 23:39:31 -0700
committerJed Foster <jed@jedfoster.com>2013-09-21 23:39:31 -0700
commit69d6fdcc0ab0003455cdccaa2fa366ae61d4e250 (patch)
tree16b085477df00a28e9f9b78dfc9cf54b27038c6a
parent6d7ebaf97e3956642eedd6f3fa68f57db2f35c4a (diff)
downloadReadmore.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.html12
1 files changed, 11 insertions, 1 deletions
diff --git a/demo.html b/demo.html
index edbda52..e24f0c9 100644
--- a/demo.html
+++ b/demo.html
@@ -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>