Giter VIP home page Giter VIP logo

angular-scroll-spy's Introduction

angular-scroll-spy

A simple, lightweight scroll-spy directive for angular that was built from scratch. It broadcasts events as elements are scrolled into or out of view.

Usage

Add the scroll-spy attribute and an id on the element you want to receive a scroll event for.

  • 'elementFirstScrolledIntoView' is fired once when the element first scrolls into view
  • 'elementScrolledIntoView' is fired every time the element scrolls into view
  • 'elementScrolledOutOfView' is fired every time the element is scrolled out of view

Then in your controller, you can respond to events like this:

$scope.$on('elementFirstScrolledIntoView', function (event, data) {
  if (data === 'myElementId') {
    // do something
  }
});

angular-scroll-spy's People

Contributors

inorganik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

angular-scroll-spy's Issues

Conflict with Bootstrap 4 CSS

I am working on implementing scroll-spy w/ countUp on a site that uses Bootstrap 4. CountUp without scroll-spy works fine. Scroll-spy will only work when the css for Bootstrap is omitted. I am thinking there is some conflict (somehow), but wanted to see if this was a known issue or something fairly straightforward to override.

Firing function on elementScrolledIntoView question

Hey...so I'm relatively new to angular (and javascript) and I'm trying to use this to fire a function on scroll but I can't get it to work. I'm using Angular Seed and I've got this code in my controller:

$scope.$on('elementFirstScrolledIntoView', function (event, data) {
            if (data === '#scroll-spy-test') {
                console.log('hey')
            }
        });

Am I missing something?

Disable coma

Hello,
is it possible to use it without coma "," ?

I would write "16853" instead of "16,853".

Thank's

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.