# blockenberg/2.0.7/blocks/feature-tabs/frontend.js

Blockenberg — 600+ Advanced Gutenberg Blocks &amp; AI Agent for WordPress Block Editor, version 2.0.7. 46 lines.

- Page: https://pluginprobe.com/plugins/blockenberg/2.0.7/code/blocks/feature-tabs/frontend.js
- Raw: https://pluginprobe.com/plugins/blockenberg/2.0.7/raw/blocks/feature-tabs/frontend.js
- Modified: 2026-03-06T12:32:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/blockenberg/2.0.7/code/blocks/feature-tabs/frontend.js#L10-L20`.

```javascript
(function () {
    'use strict';

    document.addEventListener('DOMContentLoaded', function () {
        initFeatureTabs();
    });

    function initFeatureTabs() {
        document.querySelectorAll('.bkbg-ftb-wrapper').forEach(function (wrapper) {
            var tabBtns    = wrapper.querySelectorAll('.bkbg-ftb-tab-btn');
            var panels     = wrapper.querySelectorAll('.bkbg-ftb-panel');
            var animate    = wrapper.dataset.animate === '1';

            if (!tabBtns.length || !panels.length) return;

            function activateTab(btn, idx) {
                tabBtns.forEach(function (b) {
                    b.classList.remove('is-active');
                    b.setAttribute('aria-selected', 'false');
                });
                panels.forEach(function (p) {
                    p.classList.remove('is-active');
                    p.setAttribute('aria-hidden', 'true');
                });

                btn.classList.add('is-active');
                btn.setAttribute('aria-selected', 'true');

                var target = Array.from(panels).find(function (p) {
                    return p.dataset.panel === btn.dataset.tab;
                });
                if (target) {
                    target.classList.add('is-active');
                    target.setAttribute('aria-hidden', 'false');
                }
            }

            tabBtns.forEach(function (btn, idx) {
                btn.addEventListener('click', function () {
                    activateTab(btn, idx);
                });
            });
        });
    }
})();

```
