Get started with egjs-visible CDN

MIT licensed

Egjs-visible is a library for implementing visible and invisible areas in web applications.

Tags:
  • egjs
  • visible

Stable version

Copied!

How to start using egjs-visible CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with egjs-visible CDN - cdnhub.io</title>
    <link rel="stylesheet" href="https://cdn.korea.com/egjs/2021.3.1/egjs.min.css">
    <script src="https://cdn.cdnhub.io/egjs-visible/2.4.0/visible.min.js"></script>
</head>
<body>
    <div id="container">
        <div class="item" data-visible-item data-options='{ start: 0, end: 1, offset: 200 }'>Item 1</div>
        <div class="item" data-visible-item data-options='{ start: 1, end: 2, offset: 200 }'>Item 2</div>
        <div class="item" data-visible-item data-options='{ start: 2, end: 3, offset: 200 }'>Item 3</div>
        <div class="item" data-visible-item data-options='{ start: 3, end: 4, offset: 200 }'>Item 4</div>
    </div>

    <script>
        window.onload = function() {
            new window.EG.Visible('#container', {
                onItemVisible: function(item) {
                    console.log('Item ' + item.index + ' is visible');
                }
            });
        };
    </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!

All versions