Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
Failing to initiate in-view.js

I suppose this question means that I am missing a basic understanding of how to implement a .git library.

Below, I am trying to use CamWiegert’s amazing in-view.js to trigger changes in the three boxes – but to no luck.

All help would be appreciated.

<style>
   body {
            background-color: lightskyblue;
        }

        section {
            height: 100vh;
            width: 100vw;
            display: flex;
            justify-content: center;
            align-items: center;
        }    

        .box {
            background-color: green;
            height: 40vw;
            width: 40vw;
        }

        .in-viewport .box {
            background-color: red;
        }
        
    </style>
</head>
<body>

    <section>
        <div class="box">
           
        </div>
    </section>

    <section>
        <div class="box">
           
        </div>
    </section>

    <section>
        <div class="box">
            
        </div>
    </section>
    
    <script src="https://unpkg.com/in-view@0.6.1/dist/in-view.min.js"></script>

    <script>
console.log('hello world')

inView('.section')
    .on('enter', section => {
        section.classList.add('in-viewport')
    })
    .on('exit', section => {
        section.classList.remove('in-viewport')
    });

inView.threshold(0.2)
    </script>

</body>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!