# copy-the-code/1.7.3/assets/js/page.js

Copy Anything to Clipboard for WordPress – Copy Button, Copy Text &amp; Copy Code, version 1.7.3. 36 lines.

- Page: https://pluginprobe.com/plugins/copy-the-code/1.7.3/code/assets/js/page.js
- Raw: https://pluginprobe.com/plugins/copy-the-code/1.7.3/raw/assets/js/page.js
- Modified: 2020-04-23T16:46:28+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/copy-the-code/1.7.3/code/assets/js/page.js#L10-L20`.

```javascript
(function($) {

    CopyTheCodePage = {
    	 /**
         * Init
         */
        init: function()
        {
            this._bind();
            $('.copy-the-code .nav-tab-wrapper > .nav-tab:first-child').addClass('nav-tab-active');
        },

        _bind: function()
        {
            $( document ).on('click', '.nav-tab', CopyTheCodePage._switch_tab );
        },

        _switch_tab: function( event ) {
        	$(this).siblings().removeClass('nav-tab-active');
        	$(this).addClass('nav-tab-active');
        	$( '#' + $(this).attr( 'data-id' ) ).siblings().hide();
        	$( '#' + $(this).attr( 'data-id' ) ).show();
        }

    };

    /**
     * Initialization
     */
    $(function() {
        CopyTheCodePage.init();
    });

})(jQuery);

		
```
