Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Remove active classes / Close all tabs in mobile

$
0
0

Replies: 0

I am trying to remove active classes from the tabs in mobile view. Because when there are many tabs you have to scroll to the bottom of the first tab content to see other tab titles. It would be better for the user to get an overview of all the tabs and then select what tab to open.

In short I need to close all tabs in the responsive mobile view.
This is my attempted script to override opening first tab and its content by default.

<script type=”text/javascript”>
(function($) {
if ($(window).width() < 760) {
jQuery(“.vc-tabs-li:nth-of-type(1)”).removeClass(“active”);
jQuery(“.ctu-ultimate-style-heading-2:nth-of-type(1)”).removeClass(“active”);
jQuery(“.ctu-ulitate-style-2-tabs:nth-of-type(1)”).hide();
jQuery(“.ctu-ultimate-style-heading-2:first”).removeClass(“active”);
jQuery(“.ctu-ulimate-style-2 .vc-tabs-li:first”).removeClass(“active”)

}
})(jQuery);
</script>

  • This topic was modified 34 seconds ago by jnsrmvlt.

Viewing all articles
Browse latest Browse all 59525

Trending Articles