Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

dothiswhenvisible

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dothiswhenvisible

A small jQuery plugin to excute a callback when an element is above the bottom of the viewport

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

doThisWhenVisible

A small jQuery plugin to execute a callback when an element is above the bottom of the viewport.

Usage

doThisWhenVisible is a jQuery plugin, so make sure you have jQuery on the page before you include this.

<script src="//code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="path/dist/jquery.dothiswhenvisible.min.js"></script>

Then you just need to get a hold of the element(s) you want to monitor and call doThisWhenVisible, passing in your callback.

jQuery('.target').doThisWhenVisible(function($el){
    console.log('It would appear that ', $el, ' is now visible');
});

FAQs

Package last updated on 09 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts