Skip to content

Please update main readme for beginners #90

@sengiv

Description

@sengiv

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions