1 (function($) { |
1 (function($) { |
2 $(document).ready( function() { |
2 $(document).ready( function() { |
3 /* new version */ |
3 var product = $( '.bws_product_box' ), |
4 var product = $( '.bws_product' ), |
|
5 max = 0; |
4 max = 0; |
6 $( product ).each( function () { |
5 $( product ).each( function () { |
7 if ( $( this ).outerHeight( true ) > max ) |
6 if ( $( this ).height() > max ) |
8 max = $( this ).outerHeight( true ); |
7 max = $( this ).height(); |
9 }); |
8 }); |
10 $( '.bws_product' ).css( 'height', max + 'px' ); |
9 $( '.bws_product_box' ).css( 'height', max + 'px' ); |
11 |
10 |
12 var product_links = $( '.bws_product_links' ); |
11 if ( $( '.bws-filter' ).length ) { |
13 max = 0; |
12 var prvPos = $( '.bws-filter' ).offset().top; |
14 $( product_links ).each( function () { |
13 var maxPos = prvPos + $( '.bws-products' ).outerHeight() - $( '.bws-filter' ).outerHeight(); |
15 if ( $( this ).innerHeight() > max ) |
14 |
16 max = $( this ).innerHeight(); |
15 $( window ).scroll( function() { |
17 }); |
16 if ( $( window ).width() > 580 ) { |
18 max = max - parseInt( $( '.bws_product_links' ).css( 'padding-top' ) ) - parseInt( $( '.bws_product_links' ).css( 'padding-bottom' ) ); |
17 var scrPos = Number( $( document ).scrollTop() ) + 40; |
19 $( '.bws_product_links' ).css( 'height', max + 'px' ); |
18 if ( scrPos > maxPos ) { |
20 |
19 $( '.bws-filter' ).removeClass( 'bws_fixed' ); |
21 $( '.bws_product_box' ).hover( function() { |
20 } else if ( scrPos > prvPos ) { |
22 if ( $( this ).children( '.bws_product' ).children( '.bws_product_content' ).children( '.bws_product_description' ).length > 0 ) { |
21 $( '.bws-filter' ).addClass( 'bws_fixed' ); |
23 $( this ).children( '.bws_product' ).addClass( 'bws_product_pro' ); |
22 } else { |
24 $( this ).children( '.bws_product' ).children( '.bws_product_content' ).children( '.bws_product_description' ).css( 'display', 'block' ); |
23 $( '.bws-filter' ).removeClass( 'bws_fixed' ); |
25 $( this ).children( '.bws_product' ).children( '.bws_product_content' ).children( '.bws_product_icon' ).css( 'display', 'none' ); |
24 } |
26 $( this ).children( '.bws_product' ).children( '.bws_product_button' ).css( 'display', 'inline-block' ); |
25 } |
27 } |
26 }); |
28 }, function() { |
27 } |
29 if ( $( this ).children( '.bws_product' ).children( '.bws_product_content' ).children( '.bws_product_description' ).length > 0 ) { |
28 $( '.bws-menu-item-icon' ).click( function() { |
30 $( this ).children( '.bws_product' ).removeClass( 'bws_product_pro' ); |
29 if ( $( this ).hasClass( 'bws-active' ) ) { |
31 $( this ).children( '.bws_product' ).children( '.bws_product_content' ).children( '.bws_product_description' ).css( 'display', 'none' ); |
30 $( this ).removeClass( 'bws-active' ); |
32 $( this ).children( '.bws_product' ).children( '.bws_product_content' ).children( '.bws_product_icon' ).css( 'display', 'block' ); |
31 $( '.bws-nav-tab-wrapper, .bws-help-links-wrapper' ).hide(); |
33 $( this ).children( '.bws_product' ).children( '.bws_product_button' ).css( 'display', 'none' ); |
32 } else { |
|
33 $( this ).addClass( 'bws-active' ); |
|
34 $( '.bws-nav-tab-wrapper, .bws-help-links-wrapper' ).css( 'display', 'inline-block' ); |
34 } |
35 } |
35 }); |
36 }); |
36 |
37 $( '.bws-filter-top h2' ).click( function() { |
37 /* old version */ |
38 if ( $( '.bws-filter-top' ).hasClass( 'bws-opened' ) ) { |
38 if ( $( 'input[name="bwsmn_form_email"]' ).val() == '' ) { |
39 $( '.bws-filter-top' ).removeClass( 'bws-opened' ); |
39 $( '.bws_system_info_meta_box .inside' ).css( 'display', 'none' ); |
|
40 } |
|
41 |
|
42 $( '.bws_system_info_meta_box .hndle' ).click( function() { |
|
43 if ( $( '.bws_system_info_meta_box .inside' ).is( ':visible' ) ) { |
|
44 $( '.bws_system_info_meta_box .inside' ).css( 'display', 'none' ); |
|
45 } else { |
40 } else { |
46 $( '.bws_system_info_meta_box .inside' ).css( 'display', 'block' ); |
41 $( '.bws-filter-top' ).addClass( 'bws-opened' ); |
47 } |
42 } |
48 }); |
43 }); |
49 |
44 |
50 $( '.bws_system_info_meta_box .handlediv' ).click( function() { |
|
51 if ( $( '.bws_system_info_meta_box .inside' ).is( ':visible' ) ) { |
|
52 $( '.bws_system_info_meta_box .inside' ).css( 'display', 'none' ); |
|
53 } else { |
|
54 $( '.bws_system_info_meta_box .inside' ).css( 'display', 'block' ); |
|
55 } |
|
56 }); |
|
57 }); |
45 }); |
58 })(jQuery); |
46 })(jQuery); |