-
Notifications
You must be signed in to change notification settings - Fork 237
Open
Description
Please place this in the front page readme, so beginners can spot it easy.
This's useful piece of code to see when starting especially for beginner developer.
Nice repo!
@MarkOGDev per the Setup Images and Example Code sections of the docs, the simplest possible configuration would look as follows:
<!DOCTYPE html>
<html>
<head></head>
<body>
<!-- setup images, only the data-normal attribute is required -->
<img data-normal="normal.jpg">
<!-- optionally include data-retina and data-srcset attributes -->
<img data-normal="normal.jpg"
data-retina="retina.jpg"
data-srcset="small.jpg 320w, medium.jpg 768w, large.jpg 1024w">
<!-- load Layzr -->
<script src="layzr.min.js"></script>
<!-- start up Layzr -->
<script>
const instance = Layzr();
document.addEventListener('DOMContentLoaded', function(event) {
instance
.update() // track initial elements
.check() // check initial elements
.handlers(true) // bind scroll and resize handlers
})
</script>
</body>
</html>please don't hesitate to reach out with any more questions!
Originally posted by @callmecavs in #56 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels