sticky-info.js (988B)
1 (function( $ ) { 2 'use strict'; 3 4 $.redux = $.redux || {}; 5 6 $.redux.stickyInfo = function() { 7 var stickyWidth = $( '.redux-main' ).innerWidth() - 20; 8 var $width = $( '#redux-sticky' ).offset().left; 9 10 $( '.redux-save-warn' ).css( 'left', $width + 'px' ); 11 12 if ( ! $( '#info_bar' ).isOnScreen() && ! $( '#redux-footer-sticky' ).isOnScreen() ) { 13 $( '#redux-footer' ).css( 14 { position: 'fixed', bottom: '0', width: stickyWidth, right: 21 } 15 ); 16 17 $( '#redux-footer' ).addClass( 'sticky-footer-fixed' ); 18 $( '#redux-sticky-padder' ).show(); 19 } else { 20 $( '#redux-footer' ).css( 21 { background: '#eee', position: 'inherit', bottom: 'inherit', width: 'inherit' } 22 ); 23 24 $( '#redux-sticky-padder' ).hide(); 25 $( '#redux-footer' ).removeClass( 'sticky-footer-fixed' ); 26 } 27 if ( ! $( '#info_bar' ).isOnScreen() ) { 28 $( '#redux-sticky' ).addClass( 'sticky-save-warn' ); 29 } else { 30 $( '#redux-sticky' ).removeClass( 'sticky-save-warn' ); 31 } 32 }; 33 })( jQuery );