Guenni007 icon

tabs-mobile

Guenni007 | PRO | 10/06/21 08:27:33 AM UTC | 0 ⭐ | 1309 👁️ | Never ⏰ | []
PHP |

1.02 KB

|

None

|

0 👍

/

0 👎

<?php
 
function add_bodyclass_to_tabs(){
?>
<script>
(function($) { 
  function my_tab_switch() {
    setTimeout( function() {
      if ($(window).width() <= 989) {
        $("#top").addClass("tab_switch");
      } 
      else {
        $("#top").removeClass("tab_switch");
      }
    }, 150) 
  }
  $(window).on('load resize', function() {
    my_tab_switch();
  });
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'add_bodyclass_to_tabs');
 
 
//Styling für diese Tabs
function add_styling_for_tabs(){
?>
<script>
(function($) { 
  $('.responsive #top .tabcontainer.mobile-tabs-closed .av_tab_section .tab').on('click',function() {
  $(this).toggleClass('highlite-tab');
  $(this).closest('.av_tab_section').siblings().find('.tab').removeClass('highlite-tab');
  $(this).next('.tab_content').toggleClass('mobile-tab');
  $(this).closest('.av_tab_section').siblings().find('.tab_content').removeClass('mobile-tab');
  });
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'add_styling_for_tabs');

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎