Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- onLeave: function( index, nextIndex, direction ) {
- var rows = $j( '#oceanwp-fullpage .elementor-section-wrap > .wrap-section' ),
- nextRow = rows.eq( nextIndex - 1 );
- if ( direction == 'down' ) {
- if ( nextRow.children().children( '.elementor-top-section' ).hasClass( 'light' ) ) {
- $j( 'body' ).removeClass( 'ofc-light-nav ofc-dark-nav' ).addClass( 'ofc-light-nav' );
- } else if ( nextRow.children().children( '.elementor-top-section' ).hasClass( 'dark' ) ) {
- $j( 'body' ).removeClass( 'ofc-dark-nav ofc-light-nav' ).addClass( 'ofc-dark-nav' );
- } else {
- $j( 'body' ).removeClass( 'ofc-dark-nav ofc-light-nav' );
- }
- } else if ( direction == 'up' ) {
- if ( nextRow.children().children( '.elementor-top-section' ).hasClass( 'light' ) ) {
- $j( 'body' ).removeClass( 'ofc-light-nav ofc-dark-nav' ).addClass( 'ofc-light-nav' );
- } else if ( nextRow.children().children( '.elementor-top-section' ).hasClass( 'dark' ) ) {
- $j( 'body' ).removeClass( 'ofc-dark-nav ofc-light-nav' ).addClass( 'ofc-dark-nav' );
- } else {
- $j( 'body' ).removeClass( 'ofc-dark-nav ofc-light-nav' );
- }
- }
- },
- afterLoad: function( anchorLink, index ) {
- if ( $j( this ).hasClass( 'active' ) ) {
- if ( $j( this ).children().children( '.elementor-top-section' ).hasClass( 'light' ) ) {
- $j( 'body' ).removeClass( 'ofc-light-nav ofc-dark-nav' ).addClass( 'ofc-light-nav' );
- } else if ( $j( this ).children().children( '.elementor-top-section' ).hasClass( 'dark' ) ) {
- $j( 'body' ).removeClass( 'ofc-dark-nav ofc-light-nav' ).addClass( 'ofc-dark-nav' );
- } else {
- $j( 'body' ).removeClass( 'ofc-dark-nav ofc-light-nav' );
- }
- }
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement