项目作者: BradLeftley

项目描述 :
Scroll spy for Ember.js
高级语言: JavaScript
项目地址: git://github.com/BradLeftley/ember-scroll-spy.git
创建时间: 2020-04-21T21:25:01Z
项目社区:https://github.com/BradLeftley/ember-scroll-spy

开源协议:MIT License

下载


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

  1. ember install ember-scroll-spy

Usage

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

  1. <ScrollContainer @linkId="about">
  2. <a class="nav-link js-scroll-trigger" href="#about">
  3. About
  4. </a>
  5. </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.

  1. <section class="resume-section p-3 p-lg-5 d-flex flex-column" id="about">
  2. <Anchor @id="about" ></Anchor>
  3. <div>
  4. <p>Some content</p>
  5. </div>
  6. <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.