File tree 1 file changed +0
-30
lines changed
1 file changed +0
-30
lines changed Original file line number Diff line number Diff line change 1
1
2
2
jQuery ( document ) . ready ( function ( $ ) {
3
- var timelineBlocks = $ ( '.cd-timeline-block' ) ,
4
- offset = 0.8 ;
5
-
6
- //hide timeline blocks which are outside the viewport
7
- hideBlocks ( timelineBlocks , offset ) ;
8
-
9
- //on scolling, show/animate timeline blocks when enter the viewport
10
- $ ( window ) . on ( 'scroll' , function ( ) {
11
- if ( window . requestAnimationFrame ) {
12
- return window . requestAnimationFrame ( function ( ) { showBlocks ( timelineBlocks , offset ) } ) ;
13
- }
14
- return setTimeout ( function ( ) { showBlocks ( timelineBlocks , offset ) } , 100 )
15
- } ) ;
16
-
17
- function hideBlocks ( blocks , offset ) {
18
- blocks . each ( function ( ) {
19
- if ( $ ( this ) . offset ( ) . top > $ ( window ) . scrollTop ( ) + $ ( window ) . height ( ) * offset ) {
20
- $ ( this ) . find ( '.cd-timeline-img, .cd-timeline-content' ) . addClass ( 'is-hidden' )
21
- }
22
- } ) ;
23
- }
24
-
25
- function showBlocks ( blocks , offset ) {
26
- blocks . each ( function ( ) {
27
- if ( $ ( this ) . offset ( ) . top <= $ ( window ) . scrollTop ( ) + $ ( window ) . height ( ) * offset &&
28
- $ ( this ) . find ( '.cd-timeline-img' ) . hasClass ( 'is-hidden' ) ) {
29
- $ ( this ) . find ( '.cd-timeline-img, .cd-timeline-content' ) . removeClass ( 'is-hidden' ) . addClass ( 'bounce-in' )
30
- }
31
- } ) ;
32
- }
33
3
34
4
$ ( '.sort-workshop-time' ) . click ( function ( ) {
35
5
console . log ( 'sort event - time' )
You can’t perform that action at this time.
0 commit comments