bws_menu.js
4 years ago
bws_tooltip.js
4 years ago
c_o_o_k_i_e.js
4 years ago
codemirror.js
4 years ago
general_script.js
4 years ago
shortcode-button.js
4 years ago
bws_menu.js
48 lines
| 1 | (function($) { |
| 2 | "use strict"; |
| 3 | $(document).ready( function() { |
| 4 | var product = $( '.bws_product_box' ), |
| 5 | max = 0; |
| 6 | $( product ).each( function () { |
| 7 | if ( $( this ).height() > max ) |
| 8 | max = $( this ).height(); |
| 9 | }); |
| 10 | $( '.bws_product_box' ).css( 'height', max + 'px' ); |
| 11 | |
| 12 | if ( $( '.bws-filter' ).length ) { |
| 13 | var prvPos = $( '.bws-filter' ).offset().top; |
| 14 | var maxPos = prvPos + $( '.bws-products' ).outerHeight() - $( '.bws-filter' ).outerHeight(); |
| 15 | |
| 16 | $( window ).scroll( function() { |
| 17 | if ( $( window ).width() > 580 ) { |
| 18 | var scrPos = Number( $( document ).scrollTop() ) + 40; |
| 19 | if ( scrPos > maxPos ) { |
| 20 | $( '.bws-filter' ).removeClass( 'bws_fixed' ); |
| 21 | } else if ( scrPos > prvPos ) { |
| 22 | $( '.bws-filter' ).addClass( 'bws_fixed' ); |
| 23 | } else { |
| 24 | $( '.bws-filter' ).removeClass( 'bws_fixed' ); |
| 25 | } |
| 26 | } |
| 27 | }); |
| 28 | } |
| 29 | $( '.bws-menu-item-icon' ).click( function() { |
| 30 | if ( $( this ).hasClass( 'bws-active' ) ) { |
| 31 | $( this ).removeClass( 'bws-active' ); |
| 32 | $( '.bws-nav-tab-wrapper, .bws-help-links-wrapper' ).hide(); |
| 33 | } else { |
| 34 | $( this ).addClass( 'bws-active' ); |
| 35 | $( '.bws-nav-tab-wrapper, .bws-help-links-wrapper' ).css( 'display', 'inline-block' ); |
| 36 | } |
| 37 | }); |
| 38 | $( '.bws-filter-top h2' ).click( function() { |
| 39 | if ( $( '.bws-filter-top' ).hasClass( 'bws-opened' ) ) { |
| 40 | $( '.bws-filter-top' ).removeClass( 'bws-opened' ); |
| 41 | } else { |
| 42 | $( '.bws-filter-top' ).addClass( 'bws-opened' ); |
| 43 | } |
| 44 | }); |
| 45 | |
| 46 | }); |
| 47 | })(jQuery); |
| 48 |