GithubHelp home page GithubHelp logo

bradleftley / ember-scroll-spy Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 4.68 MB

Scroll spy for Ember.js

License: MIT License

JavaScript 86.74% HTML 12.65% Handlebars 0.60%
ember ember-scroll-spy viewport

ember-scroll-spy's Introduction

ember-scroll-spy

Ember scroll spy allows you to easily replicate bootstrap's scroll spy functionality. Based on the anchor being in the viewport the scroll-container with the corresponding Id will be updated with an active class.

Simply pass through the the id to each component and the addon does the rest.

Compatibility

  • Ember.js v3.16 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

Installation

ember install ember-scroll-spy

Usage

In this current version 0.0.6 you have two components an scroll-container and an anchor.

<ScrollContainer @linkId="about">
  <a class="nav-link js-scroll-trigger" href="#about">
     About
  </a>
</ScrollContainer>

The id about will now be tracked and if it is found in the viewport the corresponding scroll-container with the same id it will be given an active class in which you can style from.

<section class="resume-section p-3 p-lg-5 d-flex flex-column" id="about">
  <Anchor @id="about" />
    <div>
     <p>Some content</p>
    </div>
<section>

Simply embed the anchor into your section, divs or any template and begin adding scroll spy to your apps.

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

ember-scroll-spy's People

Contributors

bradleftley avatar dependabot[bot] avatar wozny1989 avatar ember-tomster avatar

Stargazers

Slimane Amiar avatar Daniel Múnera Sánchez avatar Cyrille David avatar Kenneth Larsen avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

wozny1989

ember-scroll-spy's Issues

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.