Open a specific tab with cbpFWTabs

前端 未结 4 925
忘掉有多难
忘掉有多难 2021-01-27 04:34

I am using cbpFWTabs (http://tympanus.net/Development/TabStylesInspiration/) but want to open a specific tab upon page load. I have tried to emulate the show method like this in

4条回答
  •  庸人自扰
    2021-01-27 05:12

    CBPFWTabs.prototype._init = function() {
            // tabs elemes
            this.tabs = [].slice.call( this.el.querySelectorAll( 'nav > ul > li' ) );
            // content items
            this.items = [].slice.call( this.el.querySelectorAll( '.content > section' ) );
            // current index
            this.current = -1;
            // show current content item
            this._show();
            // init events
            this._initEvents();
        }; 
    

    You can change this._show(); enter your content number like this._show(1);

提交回复
热议问题