added lazy loading

This commit is contained in:
Arsen Mirzaev Tatyano-Muradovich 2024-12-22 23:16:30 +07:00
parent 6e1632cd14
commit 8c7d16500a

View File

@ -19,8 +19,11 @@ Module for creating "hot lines"
</section> </section>
``` ```
```js ```js
import("/js/modules/hotline.mjs").then((hotline) => {
// Imported the hotline.mjs module
// Initializing an instance of hotline manually // Initializing an instance of hotline manually
const instance = new hotline( const instance = new hotline.default(
'articles', 'articles',
document.getElementById('wrap_articles') document.getElementById('wrap_articles')
); );
@ -32,6 +35,7 @@ instance.delta = 15;
// Starting the hotline instance // Starting the hotline instance
instance.start(); instance.start();
});
``` ```
## Preview ## Preview