1/** 2 * eTabs.js v3.4.1 3 */ 4 ;( function( window ) { 5 6 'use strict'; 7 8 function extend( a, b ) { 9 for( var key in b ) { 10 if( b.hasOwnProperty( key ) ) { 11 a[key] = b[key]; 12 } 13 } 14 return a; 15 } 16 function IW_Tabs( el, options ) { 17 this.el = el; 18 this.options = extend( {}, this.options ); 19 extend( this.options, options ); 20 this._init(); 21 } 22 IW_Tabs.prototype.options = { 23 start : 0 24 }; 25 IW_Tabs.prototype._init = function() { 26 // tabs elems 27 this.tabs = [].slice.call( this.el.querySelectorAll( 'nav > ul > li' ) ); 28 // content items 29 this.items = [].slice.call( this.el.querySelectorAll( '.et-content-wrap > section' ) ); 30 // current index 31 this.current = -1; 32 // show current content item 33 this._show(); 34 // init events 35 this._initEvents(); 36 }; 37 IW_Tabs.prototype._initEvents = function() { 38 var self = this; 39 this.tabs.forEach( function( tab, idx ) { 40 tab.addEventListener( 'click', function( ev ) { 41 var showHideAttr = jQuery( tab ).parents( '.et-tabs' ).data( 'show-hide' ), 42 show = self._showHideTab( jQuery( tab ).attr( 'class' ), showHideAttr ); 43 44 ev.preventDefault(); 45 46 jQuery(document).trigger("resize"); 47 48 if ( show ) { 49 self._show( idx ); 50 } 51 } ); 52 } ); 53 }; 54 IW_Tabs.prototype._show = function( idx ) { 55 if( this.current >= 0 ) { 56 this.tabs[ this.current ].className = this.items[ this.current ].className = ''; 57 }
58 this.tabs.forEach( function( tab, idx ) { 59 tab.className = ""; 60 }); 61 // change current 62 this.current = idx != undefined ? idx : this.options.start >= 0 && this.options.start < this.items.length ? this.options.start : 0; 63 var hash = jQuery( jQuery( this.tabs[ this.current ] ).find( 'a' )[0] ).data('href'); 64 hash = ( 'undefined' !== typeof hash ) ? hash.substr( hash.indexOf("#") ) : ''; 65 setTimeout( function(){ 66 jQuery(document).trigger("elegantTabSwitched",[hash]); 67 }, 100 ); 68 var anim = jQuery(this.items[ this.current ]).data('animation'); 69 this.items.forEach( function( tab, idx ) { 70 tab.className = ''; 71 } ); 72 73 // Make first tab inactive. 74 if ( -1 == this.options.start ) { 75 var loaded = jQuery( jQuery( this.tabs[ this.current ] ).parents( '.elegant-tabs-container' )[0] ).data( 'loaded' ); 76 77 if ( 'undefined' !== typeof loaded || loaded ) { 78 this.tabs[ this.current ].className = 'tab-current'; 79 this.items[ this.current ].className = 'content-current'; 80 jQuery( this.items[ this.current ] ).find( '.infi-content-wrapper' )[0].className = 'infi-content-wrapper animated '+anim; 81 } 82 jQuery( jQuery( this.tabs[ this.current ] ).parents( '.elegant-tabs-container' )[0] ).attr('data-loaded', true ); 83 } else { 84 this.tabs[ this.current ].className = 'tab-current'; 85 this.items[ this.current ].className = 'content-current'; 86 jQuery( this.items[ this.current ] ).find( '.infi-content-wrapper' )[0].className = 'infi-content-wrapper animated '+anim; 87 } 88 89 }, 90 91 IW_Tabs.prototype._showHideTab = function( cls, showHideAttr ) { 92 if ( showHideAttr ) { 93 94 this.items.forEach( function( tab, idx ) { 95 tab.className = ''; 96 } ); 97
98 this.tabs.forEach( function( tabContent, idx ) { 99 tabContent.className = ''; 100 } ); 101 102 if ( 'tab-current' === cls ) { 103 return false; 104 } else { 105 return true; 106 } 107 } else { 108 return true; 109 } 110 }; 111 // add to global namespace 112 window.IW_Tabs = IW_Tabs; 113 })( window ); 114 115 function checkHash( hashLink ) { 116 if ( hashLink !== '' ) { 117 hash = hashLink.substr(hashLink.indexOf("#") ); 118 if ( jQuery( hash ).length ) { 119 var animation = jQuery( hash ).data( 'animation' ), 120 tab_link = jQuery('a[data-href="'+hash+'"]').parents("ul").find('li'), 121 tabs = jQuery(hash).parents(".et-tabs").find("section"); 122 tab_link.removeClass('tab-current'); 123 tab_link.each(function(index, element) { 124 jQuery(this).removeClass('tab-current'); 125 }); 126 tabs.each(function(index, element) { 127 jQuery(this).removeClass('content-current'); 128 }); 129 jQuery('a[data-href="'+hash+'"]').parent('li').addClass('tab-current'); 130 jQuery( hash + ' > .infi-content-wrapper' )[0].className = 'infi-content-wrapper animated ' + animation; 131 jQuery(hash).addClass('content-current'); 132 setTimeout( function(){ 133 jQuery(document).trigger("elegantTabSwitched",[hash]); 134 }, 100 ); 135 } 136 } 137 } 138 139function checkHashPosition( hash ) { 140 var hashPosition = 0; 141 hashPosition = jQuery( 'a[data-href="' + hash + '"]' ).parent( 'li' ).index(); 142 return hashPosition; 143} 144 145function elegantAutoSwitchTabs( el, interval, startTab ) { 146 var timeInterval, tabCount = 0, currnetIndex = 1; 147 148 tabCount = jQuery( el ).find( 'li' ).length; 149 150 currnetIndex = startTab + 1; 151 152 changeTabIndex(); 153 timeInterval = setInterval( function () { changeTabIndex(); }, interval * 1000); 154 155 156 function changeTabIndex() { 157 if ( currnetIndex > tabCount ) { 158 currnetIndex = 1; 159 } 160 161 var currentAncorObj = jQuery( el ).find( 'li' ).eq( currnetIndex - 1 ); 162 163 jQuery( currentAncorObj ).trigger( 'click' ); 164 165 currnetIndex++; 166 }; 167 168 jQuery( el ).find( 'li' ).mouseenter( function () { 169 clearInterval( timeInterval ); 170 }).mouseleave( function () { 171 timeInterval = setInterval( function () { changeTabIndex(); }, interval * 1000); 172 }); 173} 174 175function etGenerateCSS() { 176 var css = '<style type="text/css" id="tabs-dynamic-css">', 177 st = '', 178 bg = '', 179 color = '', 180 bg_hover = '', 181 color_hover = ''; 182 183 [].slice.call( document.querySelectorAll( '.et-tabs' ) ).forEach( function( el ) { 184 185 var url = window.location; 186 hash = url.href, 187 hashPosition = 0, 188 listContainer = '', 189 autoSwitch = false, 190 autoSwitchInterval = 5; 191 192 if ( -1 !== hash.indexOf('#') ) { 193 hash = hash.replace( "/#", '#' ); 194 hash = hash.substr( hash.indexOf( "#" ) ); 195 196 if ( jQuery( el ).find( 'a[data-href="' + hash + '"]' ).length ) { 197 hashPosition = checkHashPosition( hash ); 198 setTimeout( function() { 199 jQuery( 'html, body' ).animate( { scrollTop:( ( jQuery( hash ) ).offset().top ) - 150 }, 300 ); 200 }, 500 ); 201 } else { 202 hashPosition = ( 'undefined' !== typeof jQuery( el ).data( 'active-tab' ) ) ? jQuery( el ).data( 'active-tab' ) : 0; 203 } 204 } else { 205 hashPosition = ( 'undefined' !== typeof jQuery( el ).data( 'active-tab' ) ) ? jQuery( el ).data( 'active-tab' ) : 0; 206 } 207 208 new IW_Tabs( el, { start: hashPosition } ); 209 210 listContainer = jQuery( el ).find( '.elegant-tabs-list-container' ); 211 autoSwitch = jQuery( el ).data( 'auto-switch-tab' ); 212 autoSwitchInterval = jQuery( el ).data( 'switch-interval' ); 213 214 if ( 'no' !== autoSwitch ) { 215 elegantAutoSwitchTabs( listContainer[0], autoSwitchInterval, hashPosition ); 216 } 217 218 var cn = el.className.split(" "), 219 cl = ''; 220 221 jQuery(cn).each(function(i,v){ 222 cl += "."+v; 223 }); 224 225 st = jQuery(cl).data("tab_style"); 226 bg = jQuery(cl).data("active-bg"); 227 color = jQuery(cl).data("active-text"); 228 bg_hover = jQuery(cl).data("hover-bg"); 229 color_hover = jQuery(cl).data("hover-text"); 230 231 css += cl+' .infi-tab-accordion.infi-active-tab .infi_accordion_item{background:'+bg+' !important; color:'+color+' !important;}\n'; 232 css += cl+' .infi-tab-accordion.infi-active-tab .infi_accordion_
232item .infi-accordion-item-heading{color:'+color+' !important;}\n'; 233 css += cl+' .infi-tab-accordion.infi-active-tab .infi_accordion_item .infi-accordion-item-heading .iw-icons{color:'+color+' !important;}\n'; 234 switch(st){ 235 case 'bars': 236 css += cl+' li.tab-current a{background:'+bg+'; color:'+color+';}\n'; 237 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 238 css += cl+' li:not(.tab-current) a:hover{background:'+bg_hover+'; color:'+color_hover+';}\n'; 239 css += cl+' nav ul li:not(.tab-current) a:hover, '+cl+' nav ul li:not(.tab-current):hover a > i{color:'+color_hover+' !important;}\n'; 240 break; 241 case 'iconbox': 242 case 'iconbox-iconlist': 243 css += cl+' li.tab-current a{background:'+bg+'; color:'+color+' !important;}\n'; 244 css += cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 245 css += cl+' nav ul li.tab-current::after{color:'+bg+';}\n'; 246 css += cl+' nav ul li.tab-current{color:'+bg+' !important;}\n'; 247 css += cl+' li:not(.tab-current) a:hover{background:'+bg_hover+'; color:'+color_hover+';}\n'; 248 css += cl+' nav ul li:not(.tab-current) a:hover, '+cl+' nav ul li:not(.tab-current):hover a > i{color:'+color_hover+' !important;}\n'; 249 break; 250 case 'underline': 251 css += cl+' nav ul li a::after{background:'+bg+';}\n'; 252 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 253 css += cl+' nav ul li:not(.tab-current) a:hover:after{background:'+bg_hover+'; transform: translate3d(0,0,0);}\n'; 254 css += cl+' nav ul li:not(.tab-current) a:hover, '+cl+' nav ul li:not(.tab-current):hover a > i{color:'+color_hover+' !important;}\n'; 255 break; 256 case 'topline': 257 if ( '' == color ) { 258 color = bg; 259 } 260 css += cl+' nav ul li.tab-current a{box-shadow:inset 0px 3px 0px '+bg+';}\n'; 261 css += cl+' nav ul li.tab-current {border-top-color: '+color+';}\n'; 262 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 263 css += cl+' nav ul li:not(.tab-current):hover a{box-shadow:inset 0px 3px 0px '+bg_hover+';}\n'; 264 css += cl+' nav ul li:not(.tab-current):hover {border-top-color: '+color_hover+';}\n'; 265 css += cl+' nav ul li:not(.tab-current):hover a, '+cl+' nav ul li:not(.tab-current):hover a > i{color:'+color_hover+' !important;}\n'; 266 break; 267 case 'iconfall': 268 case 'circle': 269 case 'square': 270 css += cl+' nav ul li::before{background:'+bg+'; border-color:'+bg+';}\n'; 271 css += cl+' nav ul li.tab-current::after { border-color:'+bg+';}\n'; 272 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 273 css += cl+' nav ul li:not(.tab-current):hover::before{background:'+bg_hover+'; border-color:'+bg_hover+'; transform: translate3d(0,0,0);}\n'; 274 css += cl+' nav ul li:not(.tab-current):hover::after { border-color:'+bg_hover+';}\n'; 275 css += cl+' nav ul li:not(.tab-current):hover a, '+cl+' nav ul li:not(.tab-current):hover a > i{color:'+color_hover+' !important;}\n'; 276 break; 277 case 'line': 278 css += cl+' nav ul li.tab-current a{box-shadow:inset 0px -2px '+bg+' !important;}\n'; 279 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 280 css += cl+' nav ul li:not(.tab-current):hover a{box-shadow:inset 0px -2px '+bg_hover+' !important;}\n'; 281 css += cl+' nav ul li:not(.tab-current):hover a, '+cl+' nav ul li:not(.tab-current):hover a > i{color:'+color_hover+' !important;}\n'; 282 break; 283 case 'linebox': 284 css += cl+' nav ul li a::after{background:'+bg+';}\n'; 285 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 286 css += cl+' nav ul li:not(.tab-current):hover a::after{background:'+bg_hover+'; transform: translate3d(0,0,0);}\n'; 287 css += cl+' nav ul li:not(.tab-current):hover a, '+cl+' nav ul li:not(.tab-current):hover a > i{color:'+color_hover+' !important;}\n'; 288 break; 289 case 'flip': 290 css += cl+' nav ul li a::after, '+cl+' nav ul li.tab-current a{background:'+bg+';}\n'; 291 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 292 css += cl+' nav ul li:not(.tab-current):hover a::after, '+cl+' nav ul li:not(.tab-current):hover a{background:'+bg_hover+';
292 transform: translate3d(0,0,0);}\n'; 293 css += cl+' nav ul li:not(.tab-current):hover a, '+cl+' nav ul li:not(.tab-current):hover a > i{color:'+color_hover+' !important;}\n'; 294 break; 295 case 'tzoid': 296 var style = jQuery(cl + ' nav ul li').attr('style'); 297 css += cl+' nav ul li a::after{'+style+';}\n'; 298 css += cl+' li.tab-current a::after{background:'+bg+'; color:'+color+';}\n'; 299 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 300 css += cl+' li:not(.tab-current):hover a::after{background:'+bg_hover+'; color:'+color_hover+'; transform: perspective(5px) rotateX(0.75deg) translateZ(-1px);}\n'; 301 css += cl+' nav ul li:not(.tab-current):hover a, '+cl+' nav ul li:not(.tab-current):hover a > i{color:'+color_hover+' !important;}\n'; 302 break; 303 case 'fillup': 304 css += cl+' nav ul li.tab-current a::after{background:'+bg+';}\n'; 305 css += cl+' nav ul li a::after{background:'+bg+'; border-color: '+bg+';}\n'; 306 css += cl+' nav ul li.tab-current a, '+cl+' nav ul li.tab-current a > i{color:'+color+' !important;}\n'; 307 css += cl+' nav ul li a {border-color:'+color+' !important;}\n'; 308 css += cl+' nav ul li:not(.tab-current):hover a::after{background:'+bg_hover+'; translate3d(0,0,0)}\n'; 309 css += cl+' nav ul li:not(.tab-current):hover a::after{background:'+bg_hover+'; border-color: '+bg_hover+'; transform: translate3d(0,0,0)}\n'; 310 css += cl+' nav ul li:not(.tab-current):hover a {border-color:'+color_hover+' !important;}\n'; 311 css += cl+' nav ul li:not(.tab-current):hover a, '+cl+' nav ul li:not(.tab-current):hover a > i{color:'+color_hover+' !important;}\n'; 312 break; 313 } 314 // css += cl+' li.tab-current a{background:'+bg+'; color:'+color+';}\n'; 315 316 var listContainer = jQuery(cl).find('.elegant-tabs-list-container'); 317 listContainer.find('li').each(function(index, el) { 318 var textColor = jQuery(this).attr('data-tab-text-color'), 319 tabBGColor = jQuery(this).attr('data-tab-bg-color'), 320 $this = jQuery(this); 321 322 css += cl + ' .infi-responsive-tabs:nth-of-type(' + (index + 1) + ') .infi-tab-accordion.infi-active-tab .infi_accordion_item{background:' + tabBGColor + ' !important; color:' + textColor + ' !important;}\n'; 323 css += cl + ' .infi-responsive-tabs:nth-of-type(' + (index + 1) + ') .infi-tab-accordion.infi-active-tab .infi_accordion_item .infi-accordion-item-heading{color:' + textColor + ' !important;}\n'; 324 css += cl + ' .infi-responsive-tabs:nth-of-type(' + (index + 1) + ') .infi-tab-accordion.infi-active-tab .infi_accordion_item .infi-accordion-item-heading .iw-icons{color:' + textColor + ' !important;}\n'; 325 326 switch (st) { 327 case 'bars': 328 css += cl + ' li:nth-child(' + (index + 1) + ') a{background:' + tabBGColor + '; color:' + textColor + ';}\n'; 329 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 330 break; 331 case 'iconbox': 332 case 'iconbox-iconlist': 333 css += cl + ' li:nth-child(' + (index + 1) + ') a{background:' + tabBGColor + '; color:' + textColor + ' !important;}\n'; 334 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 335 css += cl + ' nav ul li:nth-child(' + (index + 1) + ')::after{color:' + tabBGColor + ';}\n'; 336 css += cl + ' nav ul li:nth-child(' + (index + 1) + '){color:' + tabBGColor + ' !important;}\n'; 337 break; 338 case 'underline': 339 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a::after{background:' + tabBGColor + ';}\n'; 340 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 341 break; 342 case 'topline': 343 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a{box-shadow:inset 0px 3px 0px ' + tabBGColor + ' !important;}\n'; 344 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') {border-top-color: ' + textColor + ' !important;}\n'; 345 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 346 break; 347 case 'iconfall': 348 case 'circle': 349 case 'square': 350 css += cl + ' nav ul li:nth-child(' + (index + 1) + ')::before{background:' + tabBGColor + '; border-color:' + tabBGColor + ';}\n'; 351 css += cl + ' nav ul li:nth-child(' + (index + 1) + ')::after { border-color:' + tabBGColor + ';}\n'; 352 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 353 break; 354 case 'line': 355 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a{box-shadow:inset 0px -2px ' + tabBGColor + ' !important;}\n'; 356 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 357 break; 358 case 'linebox': 359 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a::after{background:' + tabBGColor + ';}\n'; 360 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 361 break; 362 case 'flip': 363 css += cl + ' nav ul li:nth-child(' + (index + 1) + ').tab-current a::after, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ').tab-current a{background:' + tabBGColor + ';}\n'; 364 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 365 css += cl + ' nav ul li:nth-child(' + (index + 1) + '):not(.tab-current):hover a::after, ' + cl + ' nav ul li:nth-child(' + (index + 1) + '):not(.tab-current):hover a{background:' + tabBGColor + ';
365 transform: translate3d(0,0,0);}\n'; 366 css += cl + ' nav ul li:nth-child(' + (index + 1) + '):not(.tab-current):hover a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + '):not(.tab-current):hover a > i{color:' + textColor + ' !important;}\n'; 367 break; 368 case 'tzoid': 369 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a::after{background:' + tabBGColor + '; color:' + textColor + ';}\n'; 370 css += cl + ' li:nth-child(' + (index + 1) + ') a::after{background:' + tabBGColor + '; color:' + textColor + ';}\n'; 371 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 372 break; 373 case 'fillup': 374 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a::after{background:' + tabBGColor + '; border-color: ' + tabBGColor + ';}\n'; 375 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a::after{background:' + bg_hover + '; border-color: ' + bg_hover + ';}\n'; 376 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a, ' + cl + ' nav ul li:nth-child(' + (index + 1) + ') a > i{color:' + textColor + ' !important;}\n'; 377 css += cl + ' nav ul li:nth-child(' + (index + 1) + ') a {border-color:' + textColor + ' !important;}\n'; 378 break; 379 } 380 381 }); 382 383 }); 384 css += '</style>'; 385 jQuery("head").append(css); 386} 387/* Call tabs function */ 388(function() { 389 390 etGenerateCSS(); 391 392 [].slice.call( document.querySelectorAll( '.et-mobile-enabled' ) ).forEach( function( el ) { 393 // Create the dropdown base 394 var nav = jQuery(el).find("nav"); 395 jQuery("<select />", { "class":"et-mobile-tabs"}).appendTo( nav ); 396 397 // Populate dropdown with menu items 398 nav.find("a").each(function() { 399 var el = jQuery(this); 400 jQuery("<option />", { 401 "value" : el.attr("data-href"), 402 "text" : el.find('.et-tab-title').text() 403 }).appendTo(nav.find("select") ); 404 }); 405 nav.find( "select" ).change( function() { 406 var hashLink = jQuery( this ).find( "option:selected" ).val(); 407 checkHash( hashLink ); 408 }); 409 }); 410 411 jQuery("a").not('.et-anchor-tag').click( function(e){ 412 var url = jQuery(this).attr("href"); 413 if( url !== "" && typeof url !== "undefined"){ 414 var isHash = url.indexOf('#section'); 415 var isTabPage = ''; 416 hash = url.substring(url.indexOf('#section')); 417 if( isHash !== -1 ){ 418 isTabPage = jQuery(hash).length; 419 } 420 if( isHash !== -1 && isTabPage ) { 421 e.preventDefault(); 422 checkHash( url ); 423 jQuery( 'html, body' ).animate( { scrollTop:( ( jQuery(hash) ).offset().top ) - 150 }, 300 ); 424 } 425 } 426 }); 427 428 jQuery(".et-anchor-tag").hover( 429 function(){ 430 if ( ! jQuery(this).parent('li').hasClass('tab-current') ) { 431 var hover_src = jQuery(this).find('.elegant-tabs-image-icon').data( 'hover-src' ); 432 if ( '' !== hover_src ) { 433 jQuery(this).find('.elegant-tabs-image-icon').attr( 'src', hover_src ); 434 } 435 } 436 }, 437 function(){ 438 if ( ! jQuery(this).parent('li').hasClass('tab-current') ) { 439 var original_src = jQuery(this).find('.elegant-tabs-image-icon').data( 'original-src' ); 440 jQuery(this).find('.elegant-tabs-image-icon').attr( 'src', original_src ); 441 } 442 } 443 ); 444 445 jQuery( '.et-switch-on-hover .et-anchor-tag' ).on( 'hover', function() { 446 jQuery( this ).parent( 'li' ).trigger( 'click' ); 447 } ); 448 449 jQuery( document ).on( "elegantTabSwitched", function( e, hash ) { 450 jQuery(document).trigger("resize"); 451 if (typeof wpb_prepare_tab_content == 'function') { 452 wpb_prepare_tab_content( e, { newPanel: jQuery('.et-content-wrap') } ); 453 } 454 jQuery( hash ).parents( '.et-tabs' ).find( '.et-mobile-tabs' ).val( hash ); 455 jQuery( hash ).parent( '.et-content-wrap' ).find( '.infi-tab-accordion' ).removeClass( 'infi-active-tab' ); 456 jQuery('div[data-href="'+hash+'"]').parents( '.infi-tab-accordion' ).addClass( 'infi-active-tab' ); 457 jQuery( hash ).siblings().find('iframe').each( function( i ) { 458 jQuery(this).attr('src', jQuery(this).attr('src')); 459 } ); 460 var hover_src = jQuery('a[data-href*="'+hash+'"]').find('.elegant-tabs-image-icon').data( 'hover-src' ); 461 jQuery('a[data-href*="'+hash+'"]').parents( '.elegant-tabs-list-container' ).find( '.elegant-tabs-image-icon' ).each( function(){ 462 var original_src = jQuery(this).data( 'original-src' ); 463 jQuery(this).attr( 'src', original_src ); 464 });
465 if ( '' !== hover_src ) { 466 jQuery('a[data-href*="'+hash+'"]').find('.elegant-tabs-image-icon').attr( 'src', hover_src ); 467 } 468 }); 469 470 // Responsive Tabs. 471 jQuery(document).ready( function(){ 472 var accHD = document.getElementsByClassName('infi-accordion-item-heading'); 473 for (i = 0; i < accHD.length; i++) { 474 accHD[i].addEventListener('click', toggleItem.bind( self, i), false); 475 } 476 function toggleItem( index, event ) { 477 var $this = jQuery( event.target ), 478 hash = $this.data('href'), 479 itemID, 480 animation, 481 hashLink; 482 483 if ( typeof hash == 'undefined' ) { 484 hash = $this.parent( '.infi-accordion-item-heading' ).data( 'href' ); 485 $this = $this.parent( '.infi-accordion-item-heading' ); 486 } 487 488 itemID = hash; 489 animation = jQuery( itemID ).data( 'animation' ); 490 491 jQuery( itemID ).parents( '.et-tabs' ).find( 'nav > ul li').removeClass( 'tab-current' ); 492 jQuery( itemID ).parents( '.et-tabs' ).find( 'a[data-href="' + itemID +'"]').parents( 'li' ).addClass( 'tab-current' ); 493 jQuery( itemID ).parent( '.et-content-wrap' ).find( 'section' ).removeClass( 'content-current' ); 494 jQuery( itemID ).parent( '.et-content-wrap' ).find( '.infi-tab-accordion' ).removeClass( 'infi-active-tab' ); 495 $this.parents( '.infi-tab-accordion' ).addClass( 'infi-active-tab' ); 496 497 jQuery( itemID )[0].className = 'content-current'; 498 jQuery( itemID + ' > .infi-content-wrapper' )[0].className = 'infi-content-wrapper animated ' + animation; 499 jQuery( 'html, body' ).animate( { scrollTop:( ( $this ).offset().top ) - 85 }, 300 ); 500 } 501 }); 502})();
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.