Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit 595ebfb

Browse files
committed
Added bootstrap animation back only on client side to keep animation
1 parent c04c15a commit 595ebfb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/pages/app-home/app-home.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { BlogPost } from '../../model/blog-post.model';
66
import * as Fetch from '../../shared/fetch-handler';
77

88
/* tslint:disable-next-line */
9+
declare var bootstrap;
910

1011
@Component({
1112
tag: 'app-home',
@@ -50,14 +51,13 @@ export class AppHome {
5051
});
5152

5253
if (Build.isBrowser) {
53-
/* tslint:disable-next-line */
54-
const items = document.querySelectorAll('.carousel-item');
55-
let n = items.length;
56-
this.timer = setInterval(() => {
57-
this.currItem = ++this.currItem % n;
58-
items.forEach(el => el.classList.remove('active'));
59-
items[this.currItem].classList.add('active');
60-
}, 4000);
54+
$(document).ready(function() {
55+
// Force bootstrap to initialize carousel
56+
const processCarousel = $('#processCarousel');
57+
setTimeout(() => bootstrap.Carousel._jQueryInterface.call(processCarousel, processCarousel.data()), 0);
58+
59+
$(window).trigger('scroll'); // init the value
60+
});
6161
}
6262
}
6363

0 commit comments

Comments
 (0)