jQuery(document).ready(function() { //When page loads... jQuery( '.tab-content' ).hide(); //Hide all content jQuery( 'ul.tabs li:eq(0)' ).addClass( 'active' ).show(); //Show Default Tab content jQuery( '.tab-content:eq(0)' ).show(); // Change the EQ Number to which tab you want to show as default //On Click Event jQuery( 'ul.tabs li' ).click(function() { jQuery( 'ul.tabs li' ).removeClass('active'); //Remove any "active" class jQuery(this).addClass( 'active' ); //Add "active" class to selected tab jQuery( '.tab-content' ).hide(); //Hide all tab content var activeTab = jQuery(this).find( 'a' ).attr( 'href' ); //Find the href attribute value to identify the active tab + content if ( jQuery.browser.msie ) { jQuery( activeTab ).show(); } else { jQuery( activeTab ).fadeIn(); } //Fade in the active ID content return false; }); //Hide (Collapse) the toggle containers on load jQuery( '.toggle-container' ).hide(); //Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state) jQuery( '.tab-content h3' ).click(function(){ jQuery(this).toggleClass( 'active' ).next().slideToggle( 'fast' ); return false; //Prevent the browser jump to the link anchor }); // Hide ColorPicker jQuery( '.color_picker' ).hide(); // FadeIn Color Picker when field_color is on focus jQuery( '.field_color_picker' ).focus(function(){ jQuery(this).toggleClass( 'active' ).next().fadeIn(); return false; //Prevent the browser jump to the link anchor }); // FadeOut Color Picker when field_color is on blur jQuery( '.field_color_picker' ).blur(function(){ jQuery(this).toggleClass( 'active' ).next().fadeOut(); return false; //Prevent the browser jump to the link anchor }); // Add the Colors to Fields jQuery( '#body_font_color_picker' ).farbtastic( '#body_font_color' ); jQuery( '#anchor_color_picker' ).farbtastic( '#anchor_color' ); jQuery( '#anchor_hover_color_picker' ).farbtastic( '#anchor_hover_color' ); jQuery( '#anchor_visited_color_picker' ).farbtastic( '#anchor_visited_color' ); jQuery( '#headings_font_color_picker' ).farbtastic( '#headings_font_color' ); // Fading Notifications setTimeout(function(){ jQuery( '.fade' ).fadeOut( 'slow', function () { jQuery( '.fade' ).remove(); }); }, 2000); }); // Document Ready