Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please update main readme for beginners #90

Open
sengiv opened this issue May 12, 2022 · 0 comments
Open

Please update main readme for beginners #90

sengiv opened this issue May 12, 2022 · 0 comments

Comments

@sengiv
Copy link

sengiv commented May 12, 2022

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant