EduardET

Untitled

Feb 26th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <script>
  2. ( function( $ ) {
  3. $( document ).ready( function() {
  4. function setClass() {
  5. if ( $( 'body' ).hasClass( 'single-product' ) ) {
  6. $( '.component_option_thumbnails_container .component_option_thumbnail_container:nth-child(n)' ).removeClass( 'last' ).removeClass( 'first' );
  7. $( '.component_option_thumbnails_container .component_option_thumbnail_container:first-child' ).addClass( 'first' );
  8. $( '.component_option_thumbnails_container .component_option_thumbnail_container:nth-child(3n)' ).addClass( 'last' );
  9.  
  10. //Review Configuration
  11. $( '.summary_elements .summary_element:nth-child(n)' ).removeClass( 'last' ).removeClass( 'first' );
  12. $( '.summary_elements .summary_element:first-child' ).addClass( 'first' );
  13. $( '.summary_elements .summary_element:nth-child(2n)' ).addClass( 'last' );
  14. }
  15. }
  16. setClass();
  17. $( document ).ajaxComplete( function() {
  18. setClass();
  19. } )
  20. } );
  21. } )( jQuery );
  22. </script>
Advertisement
Add Comment
Please, Sign In to add comment