angular-simple-scroll-spy

This is craeted by ng-packagr on Angular6.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
angular-simple-scroll-spy
020.0.35 years ago5 years agoMinified + gzip package size for angular-simple-scroll-spy in KB

Readme

Angular 2+ Simple Scroll Spy Directive
This is craeted by ng-packagr on Angular6.

Installation

``` npm install angular-simple-scroll-spy --save ```

Usage

In Module:

App Module

```typescript import {SimpleScrollSpyModule} from "angular-simple-scroll-spy"; @NgModule({
imports: [SimpleScrollSpyModule]
}) ``` or

Shared Module

```typescript import {SimpleScrollSpyModule} from "angular-simple-scroll-spy"; @NgModule({
imports: [SimpleScrollSpyModule],
exports: [SimpleScrollSpyModule]
}) ```

In Component:

Menu Template

```html
  • currentContent="currentMenuId">Menu 1
  • currentContent="currentMenuId">Menu 2
  • currentContent="currentMenuId">Menu 3
```

Content Template

```html
(currentContent)="currentMenuId">
content1
content2
content3
```

Component Class

```typescript currentMenuId = "menu1"; ```

Properties:

|scrollSpyMenu|| -|- |scrollSpyMenu|Target content element id.| |ssmActiveClassName|Class attribute value when active. default:'active'| |ssmCurrentContent|Send current selected element id.| |ssmScrollBehavior|Element.scrollIntoView options. default:'smooth'| |ssmScrollBlock|Element.ScrollIntoView options. default:'start'| |ssmScrollInline|Element.ScrollIntoView options. default:'nearest'| |scrollSpyContent|| -|- |scrollSpyContent|Target element tag name.| |sscCurrentContent|Send current selected element id.| |sscCurrentContentChange|Output bind of 'sscCurrentContent'.| |sscDirection|Scroll direction, 'row'|'column'. default:'row'|

Demo

``` npm run start ``` or demo on sandbox