You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple lightweight library for [Angular][angular] that detects scroll direction and adds a `sn-scrolling-up` or `sn-scrolling-down` class to the element. The library can also detect when the user has scrolled passed the element and apply a `sn-affix` class. Useful for make a element sticky when the user has scrolled beyond it. This library can will also apply `sn-minimise` class after the user has scrolled beyond the height of the element.
7
9
8
10
This is a simple library for [Angular][angular], implemented in the [Angular Package Format v5.0][apfv5].
9
11
10
-
11
12
## Install
12
13
13
14
### via NPM
@@ -19,6 +20,7 @@ This is a simple library for [Angular][angular], implemented in the [Angular Pac
@@ -47,10 +50,9 @@ import { ScrollCollapseModule } from '@thisissoon/angular-scroll-collapse';
47
50
ScrollCollapseModule
48
51
]
49
52
})
50
-
exportclassAppServerModule {}
53
+
exportclassAppServerModule {}
51
54
```
52
55
53
-
54
56
## Examples
55
57
56
58
A working example can be found inside [/src](https://github.com/thisissoon/angular-scroll-collapse/tree/master/src) folder.
@@ -66,11 +68,11 @@ A working example can be found inside [/src](https://github.com/thisissoon/angul
66
68
```css
67
69
.foo {
68
70
left: 0;
69
-
height: 100px;
71
+
height: 100px;
70
72
position: fixed;
71
73
right: 0;
72
74
top: 0;
73
-
transition: all.35sease-in-out;
75
+
transition: all0.35sease-in-out;
74
76
}
75
77
76
78
.foo.sn-scrolling-down {
@@ -102,7 +104,6 @@ In this scenario the nav element will have the class `sn-affix` added when the u
102
104
}
103
105
```
104
106
105
-
106
107
### Minimise mode
107
108
108
109
In this scenario the nav element will have the class `sn-minimise` added when the user scrolls 100px (the original height of the element) down the page.
@@ -117,8 +118,7 @@ In this scenario the nav element will have the class `sn-minimise` added when th
117
118
.foo {
118
119
left: 0;
119
120
height: 100px;
120
-
position
121
-
right: 0;
121
+
positionright: 0;
122
122
top: 0;
123
123
}
124
124
@@ -135,7 +135,6 @@ In this scenario the nav element will have the class `sn-minimise` added when th
135
135
</header>
136
136
```
137
137
138
-
139
138
## Development server
140
139
141
140
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
@@ -168,18 +167,19 @@ Run `npm run release` to create a new release. This will use [Standard Version][
168
167
169
168
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README][angular-cli-readme].
0 commit comments