Created
October 28, 2015 15:04
-
-
Save ssylvia/3133521833e8e6f119e8 to your computer and use it in GitHub Desktop.
JavaScript used to add Readmore.js to a Story Map Tour https://medium.com/developing-a-story-map/showcase-your-photos-in-map-tour-with-readmore-js-6f004d5d612#.cpifuoat2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// Get the full url to the app so we can load the readmore.js file | |
var path = location.pathname.replace(/\/[^/]+$/, '/'); | |
// require Readmore.js and app events | |
require(["dojo/topic", path + "app/readmore.min.js"], function(topic) { | |
// After each point change, call readmore on the description pane | |
topic.subscribe("maptour-point-change-after", function(){ | |
$('.description').readmore({ | |
collapsedHeight: 10, | |
blockCSS: 'float: left; padding: 10px;' | |
}); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment