scrollout js angular
//Install via npm
$ npm i scroll-out -S
//in your component.ts
import ScrollOut from 'scroll-out';
@Component(/**/)
export class MyComponent implements AfterContentInit, OnDestroy {
so: any;
constructor(private el: ElementRef) {}
ngAfterContentInit() {
this.so = ScrollOut({
scope: this.el.nativeElement
});
}
ngOnDestroy() {
this.so.teardown();
}
}
//In your component.css
[data-scroll] {
transition: opacity 1s;
}
[data-scroll="in"] {
opacity: 1;
}
[data-scroll="out"] {
opacity: 0;
}
//In your component.html
<div data-scroll>Watch me fading in!</div>
Also in JavaScript:
- starting with react router dom
- vuejs components props pass array
- jquery count elements
- jquery get value of radio input
- how play audio js
- localecompare javascript
- python json change line
- Find channel discord js
- js find element in array by property
- loop through object in array javascript
- glide.js autoplay
- bootstrap javascript cdn
- open another page js
- get last char javascript
- hide show div jquery
- test load function benchmark javascript
- react cloud foundry nginx proxy
- cannot access function before initialization js
- integers to space separated string in javascript
- linked list javascript
- how to export mongodb database to json
- get meta tag value from url javascript
- javascript detect page
- ajax post cancel request