almost finished website
This commit is contained in:
@@ -59,7 +59,16 @@ $( document ).ready( function () {
|
||||
}
|
||||
|
||||
$( '.progress-item' ).click( function () {
|
||||
let future = parseInt( $( this ).attr( 'id' ).substring( 4 ) ) - 1;
|
||||
moveTo( parseInt( $( this ).attr( 'id' ).substring( 4 ) ) );
|
||||
} );
|
||||
|
||||
$( '.scroll-wrapper' ).click( function () {
|
||||
moveTo( currentlyShowing + 1 );
|
||||
} );
|
||||
|
||||
function moveTo ( id ) {
|
||||
$( '#scroll-hint' ).fadeOut( 300 );
|
||||
let future = id - 1;
|
||||
for ( let i = 0; i < future + 1; i++ ) {
|
||||
$( `#step-${i + 1}` ).addClass( 'active' );
|
||||
}
|
||||
@@ -67,8 +76,14 @@ $( document ).ready( function () {
|
||||
for ( let i = future + 1; i < revealables.length + 1; i++ ) {
|
||||
$( `#step-${i + 1}` ).removeClass( 'active' );
|
||||
}
|
||||
|
||||
clearTimeout( timeout );
|
||||
$( '#scroll-hint' ).fadeOut( 300 );
|
||||
if ( future < revealables.length ) {
|
||||
timeout = setTimeout( showScrollHint, 7000 );
|
||||
}
|
||||
currentlyShowing = future;
|
||||
trackProgress();
|
||||
window.scrollTo( { top: ( parseInt( $( this ).attr( 'id' ).substring( 4 ) ) - 1 ) * heights, behavior: 'instant' } );
|
||||
} );
|
||||
window.scrollTo( { top: id * heights, behavior: 'instant' } );
|
||||
}
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user