Closed Ezra-Siton-UIX closed 2 years ago
Hey!
All npm packages are included in unpkg CDN.
So, Read Smore is found at https://unpkg.com/read-smore which will resolve specifically to the latest umd version (currently) at https://unpkg.com/read-smore@2.0.4/dist/index.umd.js.
So, if you add the script to your project:
<script src="https://unpkg.com/read-smore@2.0.4/dist/index.umd.js"></script>
You can initialize it like:
const ReadSmore = window.readSmore // target all read more elements const readMoreEls = document.querySelectorAll('.js-read-smore') // Init ReadSmore(readMoreEls).init()
And you're gtg.
Here's a CodePen example
I suppose I can also update the ReadMe / Docs.
Thanks.
Thanks!!
Hey!
All npm packages are included in unpkg CDN.
So, Read Smore is found at https://unpkg.com/read-smore which will resolve specifically to the latest umd version (currently) at https://unpkg.com/read-smore@2.0.4/dist/index.umd.js.
So, if you add the script to your project:
You can initialize it like:
And you're gtg.
Here's a CodePen example
I suppose I can also update the ReadMe / Docs.
Thanks.