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
Note: The `scroll()` method is a shorthand from creating a `PageScrollInstance` (an object encapsulating all information
103
-
relevant for performing a scroll animation) using `PageScrollService#create` and starting it using
103
+
Note: The `scroll()` method is a shorthand from creating a `PageScrollInstance` (an object encapsulating all information
104
+
relevant for performing a scroll animation) using `PageScrollService#create` and starting it using
104
105
the `PageScrollService#start` method.
105
106
106
107
### Configuration
@@ -120,8 +121,8 @@ object.
120
121
121
122
## Directive
122
123
123
-
For ease of use a directive `pageScroll` exists, which allows you to quickly add scroll animations to your angular app by
124
-
adding a property to your existing HTML a-tags. It can also work cross-routes, meaning it will start the scroll animation
124
+
For ease of use a directive `pageScroll` exists, which allows you to quickly add scroll animations to your angular app by
125
+
adding a property to your existing HTML a-tags. It can also work cross-routes, meaning it will start the scroll animation
125
126
after the target route has been loaded.
126
127
It utilizes the ngx-page-scroll-core module for that, thus requires it as a peer dependency.
127
128
@@ -147,11 +148,11 @@ export class AppModule {
147
148
}
148
149
```
149
150
150
-
### Usage
151
+
### Usage
151
152
152
-
In your template you may add the `pageScroll` attribute to elements with an `href` attribute pointing towards an id on
153
+
In your template you may add the `pageScroll` attribute to elements with an `href` attribute pointing towards an id on
153
154
the same page (e.g. `#theId`). The `onClick` event will be interrupted and the scroll animation starts.
154
-
Alternatively you may set the optional `pageScrollTarget` property to a valid css selector to specify the
155
+
Alternatively you may set the optional `pageScrollTarget` property to a valid css selector to specify the
155
156
target element to scroll to.
156
157
157
158
```typescript
@@ -171,8 +172,8 @@ export class MyComponent {
171
172
### Directive API
172
173
173
174
Additional attributes may be set on an DOM element using the `pageScroll` directive for customization.
174
-
They take precedence over the default settings specified in `PageScrollConfig` class. Thereby it is
175
-
possible to have all page scroll-animations last e.g. 2 seconds, but a specific one should be performed with a custom easing function and a duration
175
+
They take precedence over the default settings specified in `PageScrollConfig` class. Thereby it is
176
+
possible to have all page scroll-animations last e.g. 2 seconds, but a specific one should be performed with a custom easing function and a duration
176
177
of only 1 second.
177
178
178
179
#### PageScroll properties
@@ -184,7 +185,7 @@ of only 1 second.
184
185
| `pageScrollHorizontal` | boolean | false | Whether the scroll should happen in vertical direction (`false`, default) or horizontal (`true`).
185
186
| `pageScrollOffset` | number | 0 | Pixels to offset from the top of the element when scrolling to (positive value = scrolling will stop given pixels atop the target element).
186
187
| `pageScrollDuration` | number | 1250 | Duration in milliseconds the whole scroll-animation should last.
187
-
| `pageScrollSpeed` | number | - | Speed in Pixel/Second the animation should take. Only applied if no duration is set.
188
+
| `pageScrollSpeed` | number | - | Speed in Pixel/Second the animation should take. Only applied if no duration is set.
188
189
| `pageScrollInView` | boolean | true | Whether the scroll animation should happen even when the scroll target is already inside the view port (`true`). Set to `false` to skip scroll animation if target is already in view.
189
190
| `pageScrollInterruptible` | boolean | true | Whether the scroll animation should stop if the user interferes with it (`true`) or not (`false`).
190
191
| `pageScrollAdjustHash` | boolean | false | Whether the [routes hash/fragment](https://angular.io/docs/ts/latest/guide/router.html#!#query-parameters) should be updated to reflect to section that has been scrolled to
@@ -198,17 +199,17 @@ of only 1 second.
198
199
199
200
#### Example
200
201
201
-
The following example will check whether the route _Home_ is currently loaded.
202
-
If this is true, the scroll-animation will be performed with the default
203
-
properties. If a different route is loaded, a subscription for route changes
204
-
will be made and the scroll-animation will be performed as soon as the new
202
+
The following example will check whether the route _Home_ is currently loaded.
203
+
If this is true, the scroll-animation will be performed with the default
204
+
properties. If a different route is loaded, a subscription for route changes
205
+
will be made and the scroll-animation will be performed as soon as the new
0 commit comments