PageSourceSearch

https://greekdrivingtheorytest.com/wp-content/themes/dmvpermittest/js/cbpFWTabs.js

js greekdrivingtheorytest.com collected 2026-10-02 01:31:27 UTC 2,015 bytes, 86 lines download raw bytes

1/**
2 * cbpFWTabs.js v1.0.0
3 * http://www.codrops.com
4 *
5 * Licensed under the MIT license.
6 * http://www.opensource.org/licenses/mit-license.php
7 * 
8 * Copyright 2014, Codrops
9 * http://www.codrops.com
10 */
11;( function( window ) {
12	
13	'use strict';
14
15	function extend( a, b ) {
16		for( var key in b ) { 
17			if( b.hasOwnProperty( key ) ) {
18				a[key] = b[key];
19			}
20		}
21		return a;
22	}
23
24	function CBPFWTabs( el, options ) {
25		this.el = el;
26		this.options = extend( {}, this.options );
27  		extend( this.options, options );
28  		this._init();
29	}
30
31	CBPFWTabs.prototype.options = {
32		start : 0
33	};
34
35	CBPFWTabs.prototype._init = function() {
36		// tabs elems
37		this.tabs = [].slice.call( this.el.querySelectorAll( 'nav > ul > li' ) );
38		// content items
39		this.items = [].slice.call( this.el.querySelectorAll( '.content-wrap > section' ) );
40		// current index
41		this.current = -1;
42		// show current content item
43		this._show();
44		// init events
45		this._initEvents();
46	};
47
48	CBPFWTabs.prototype._initEvents = function() {
49		var self = this;
50		this.tabs.forEach( function( tab, idx ) {
51			tab.addEventListener( 'click', function( ev ) {
52				ev.preventDefault();
53				self._show( idx );
54			} );
55		} );
56	};
57
58	CBPFWTabs.prototype._show = function( idx ) {
59		if( this.current >= 0 ) {
60			this.tabs[ this.current ].className = this.items[ this.current ].className = '';
61		}
62		if(idx == undefined ){
63			var quiz_premium = document.getElementById("req_type").value;
64
65			if(quiz_premium == "car"){
66				idx = 0;
67			}else if(quiz_premium == "bike"){
68				idx = 1;
69			}else if(quiz_premium == "truck"){
70				idx= 2;
71			}else if(quiz_premium == "bus"){
72				idx= 3;
73			}else{
74				idx = idx;
75			}
76		}
77		// change current
78		this.current = idx != undefined ? idx : this.options.start >= 0 && this.options.start < this.items.length ? this.options.start : 0;
79		this.tabs[ this.current ].className = 'tab-current';
80		this.items[ this.current ].className = 'content-current';
81	};
82
83	// add to global namespace
84	window.CBPFWTabs = CBPFWTabs;
85
86})( window );

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.