/* */ jQuery(document).ready(function(){ //Add Class Js to html jQuery('html').addClass('js'); //=================================== MENU ===================================// jQuery("ul.sf-menu").supersubs({ minWidth : 13, // requires em unit. maxWidth : 13, // requires em unit. extraWidth : 3 // extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values // due to slight rounding differences and font-family }).superfish(); // call supersubs first, then superfish, so that subs are // not display:none when measuring. Call before initialising // containing tabs for same reason. //=================================== MOBILE MENU DROPDOWN ===================================// jQuery('#topnav').tinyNav({ active: 'selected' }); //=================================== TABS AND TOGGLE ===================================// //jQuery tab jQuery(".tab-content").hide(); //Hide all content jQuery("ul.tabs li:first").addClass("active").show(); //Activate first tab jQuery(".tab-content:first").show(); //Show first tab content //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 rel attribute value to identify the active tab + content jQuery(activeTab).fadeIn(200); //Fade in the active content return false; }); //jQuery toggle jQuery(".toggle_container").hide(); jQuery("h2.trigger").click(function(){ jQuery(this).toggleClass("active").next().slideToggle("slow"); }); // Accordion jQuery("ul.ts-accordion li").each(function(){ if(jQuery(this).index() > 0){ jQuery(this).children(".accordion-content").css('display','none'); }else{ jQuery(this).find(".accordion-title").addClass('active'); } jQuery(this).children(".accordion-title").bind("click", function(){ jQuery(this).addClass(function(){ if(jQuery(this).hasClass("active")) return ""; return "active"; }); jQuery(this).siblings(".accordion-content").slideDown(); jQuery(this).parent().siblings("li").children(".accordion-content").slideUp(); jQuery(this).parent().siblings("li").find(".active").removeClass("active"); }); }); //=================================== FADE EFFECT ===================================// if (jQuery.browser.msie && jQuery.browser.version < 7) return; // Don't execute code if it's IE6 or below cause it doesn't support it. jQuery('.ts-pf-img').hover( function() { jQuery(this).find('.rollover').stop().fadeTo(500, 0.60); }, function() { jQuery(this).find('.rollover').stop().fadeTo(500, 0); } ) //=================================== PRETTYPHOTO ===================================// jQuery('a[data-rel]').each(function() {jQuery(this).attr('rel', jQuery(this).data('rel'));}); jQuery("a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',theme:'facebook',gallery_markup:'',slideshow:2000}); //=================================== BACK TO TOP ===================================// jQuery(window).scroll(function() { if(jQuery(this).scrollTop() != 0) { jQuery('#toTop').fadeIn(); } else { jQuery('#toTop').fadeOut(); } }); jQuery('#toTop').click(function() { jQuery('body,html').animate({scrollTop:0},800); }); });