jQuery(document).ready(function( $ ) { $( ".flexslider" ).flexslider({ animation: "fade", //String: Select your animation type, "fade" or "slide" slideshow: true, //Should the slider animate automatically by default? (true/false) slideshowSpeed: 8000, //Set the speed of the slideshow cycling, in milliseconds animationDuration: 800, //Set the speed of animations, in milliseconds directionNav: true, //Create navigation for previous/next navigation? (true/false) controlNav: true, //Create navigation for paging control of each clide? (true/false) keyboardNav: true, //Allow for keyboard navigation using left/right keys (true/false) touchSwipe: true, //Touch swipe gestures for left/right slide navigation (true/false) prevText: "Previous", //Set the text for the "previous" directionNav item nextText: "Next", //Set the text for the "next" directionNav item randomize: false, //Randomize slide order on page load? (true/false) slideToStart: 0, //The slide that the slider should start on. Array notation (0 = first slide) pauseOnAction: true, //Pause the slideshow when interacting with control elements, highly recommended. (true/false) pauseOnHover: false, //Pause the slideshow when hovering over slider, then resume when no longer hovering (true/false) controlsContainer: ".flexslider-container" //Advanced property: Can declare which container the navigation elements should be appended too. Default container is the flexSlider element. Example use would be ".flexslider-container", "#container", etc. If the given element is not found, the default action will be taken. } ); /*-----------------------------------------------------------------------------------*/ /* Social Icons /*-----------------------------------------------------------------------------------*/ $('#facebook, #twitter, #flickr, #vimeo, #youtube, #linkedin, #googleplus, #dribbble, #tumblr, #skype, #delicious, #digg, #rss, #soundcloud, #forrst').append('').each(function () { var $span = $('> span.hover', this).css('opacity', 0); $(this).hover(function () { $span.stop().fadeTo(500, 1); }, function () { $span.stop().fadeTo(500, 0); }); }); /*-----------------------------------------------------------------------------------*/ /* Drop-down Page /*-----------------------------------------------------------------------------------*/ var $dropDownWrapper = $( '#dropdown-wrapper' ); if ( $dropDownWrapper.length ) { $('#dropdown-trigger').click(function() { var pageHeight = $('.dropdown-page').height() + 60; // Get the height, while including the top and bottom padding of the drop-down page var wrapperHeight = $dropDownWrapper.height(); // Animate the height of the wrapper, depending on the current state (visible or not) if( wrapperHeight == 0 ) { $('.drop-down-arrows').css('backgroundPosition', 'left top'); $dropDownWrapper.animate( { height: pageHeight }, 700, 'easeOutCubic', function() { $(this).css('height', 'auto'); }); } else { $('.drop-down-arrows').css('backgroundPosition', '0px -11px'); $dropDownWrapper.animate( { height: 0 }, 500, 'easeOutCubic' ); } $( 'body, html' ).animate({ scrollTop: 0 }, 200, 'easeOutCubic' ); }); } /*-----------------------------------------------------------------------------------*/ /* BACKGROUND FIX /*-----------------------------------------------------------------------------------*/ var theWindow = jQuery(window), $bg = jQuery("#full_background"), aspectRatio = $bg.width() / $bg.height(); function resizeBg() { if ( (theWindow.width() / theWindow.height()) < aspectRatio ) { $bg .removeClass() .addClass('bgheight'); } else { $bg .removeClass() .addClass('bgwidth'); } } theWindow.resize(function() { resizeBg(); }).trigger("resize"); /*-----------------------------------------------------------------------------------*/ /* ISOTOPE ACTIVATION /*-----------------------------------------------------------------------------------*/ var $container = $('#container'); $container.imagesLoaded( function(){ $container.isotope({ itemSelector : '.element', }); }); var $container = $('#container'); $container.isotope({ itemSelector : '.element', // disable resizing // set columnWidth to a percentage of container width masonry: { columnWidth: $container.width() / 4 }, getSortData : { symbol : function( $elem ) { return $elem.attr('data-symbol'); }, category : function( $elem ) { return $elem.attr('data-category'); }, number : function( $elem ) { return parseInt( $elem.find('.number').text(), 10 ); }, weight : function( $elem ) { return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') ); }, name : function ( $elem ) { return $elem.find('.name').text(); } } }); // update columnWidth on window resize $(window).smartresize(function(){ $container.isotope({ // set columnWidth to a percentage of container width masonry: { columnWidth: $container.width() / 4 } }); }); var $optionSets = $('#options .option-set'), $optionLinks = $optionSets.find('a'); $optionLinks.click(function(){ var $this = $(this); // don't proceed if already selected if ( $this.hasClass('selected') ) { return false; } var $optionSet = $this.parents('.option-set'); $optionSet.find('.selected').removeClass('selected'); $this.addClass('selected'); // make option object dynamically, i.e. { filter: '.my-filter-class' } var options = {}, key = $optionSet.attr('data-option-key'), value = $this.attr('data-option-value'); // parse 'false' as false boolean value = value === 'false' ? false : value; options[ key ] = value; if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) { // changes in layout modes need extra logic changeLayoutMode( $this, options ) } else { // otherwise, apply new options $container.isotope( options ); } return false; }); // toggle variable sizes of all elements $('#toggle-sizes').find('a').click(function(){ $container .toggleClass('variable-sizes') .isotope('reLayout'); return false; }); var $sortBy = $('#sort-by'); $('#shuffle a').click(function(){ $container.isotope('shuffle'); $sortBy.find('.selected').removeClass('selected'); $sortBy.find('[data-option-value="random"]').addClass('selected'); return false; }); /*-----------------------------------------------------------------------------------*/ /* Search Movement /*-----------------------------------------------------------------------------------*/ // Search Movement jQuery(".search-wrapper").filter(":first").find("#searchsubmit").click(function(){ if( jQuery(this).siblings("#search-text").width() == 1 ){ jQuery(this).siblings("#search-text").children("input[type='text']").val(''); jQuery(this).siblings("#search-text").animate({ width: '170px' }); jQuery(this).siblings("#search-text").children("input[type='text']").focus(); return false; } if( jQuery(this).siblings("#search-text").children("input[type='text']").val() == '' ){ return false; } }); jQuery("#searchform").click(function(){ if (event.stopPropagation){ event.stopPropagation(); } else if(window.event){ window.event.cancelBubble=true; } //event.stopPropagation(); }); jQuery("html").click(function(){ jQuery(this).find(".search-wrapper").filter(":first").find("#search-text").animate({ width: '1px' }); }); /*-----------------------------------------------------------------------------------*/ /* DropDown Menu - http://users.tpg.com.au/j_birch/plugins/superfish/ /*-----------------------------------------------------------------------------------*/ /* $(".menu ul li").horizontalMenu({ timeHide: 900 }); */ $("ul.sf-menu").supersubs({ minWidth: 13, // minimum width of sub-menus in em units maxWidth: 25, // maximum width of sub-menus in em units extraWidth: 1 // extra width can ensure lines don't sometimes turn over // due to slight rounding differences and font-family }).superfish({ delay: 400, Speed: 'normal', animation: {height:'show'}, // slide-down effect without fade-in autoArrows: true, }); $("#responsive-nav select").change(function() { window.location = $(this).find("option:selected").val(); }); /*-----------------------------------------------------------------------------------*/ /* Navigation Animation /*-----------------------------------------------------------------------------------*/ $('nav ul.sf-menu ul li a').mouseover(function () { $(this).stop().animate({ paddingLeft: "22px" }, 100 ); }); $('nav ul.sf-menu ul li a').mouseout(function () { $(this).stop().animate({ paddingLeft: "17px" }, 100 ); }); /*-----------------------------------------------------------------------------------*/ /* MOBILE MENU /*-----------------------------------------------------------------------------------*/ $('.sf-menu').mobileMenu(); //Responsive Select Menu if (!$.browser.opera) { $('select.select-menu').each(function(){ var title = $(this).attr('title'); if( $('option:selected', this).val() != '' ) title = $('option:selected',this).text(); $(this) .css({'z-index':10,'opacity':0,'-khtml-appearance':'none'}) .after('' + title + '') .change(function(){ val = $('option:selected',this).text(); $(this).next().text(val); }) }); }; /*-----------------------------------------------------------------------------------*/ /* Pretty Photo /*-----------------------------------------------------------------------------------*/ $("a[rel^='prettyPhoto']").prettyPhoto({ animation_speed: 'fast', /* fast/slow/normal */ slideshow: 5000, /* false OR interval time in ms */ autoplay_slideshow: false, /* true/false */ opacity: 0.80, /* Value between 0 and 1 */ show_title: true, /* true/false */ allow_resize: true, /* Resize the photos bigger than viewport. true/false */ default_width: 500, default_height: 344, counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */ theme: 'pp_default', /* light_rounded / dark_rounded / light_square / dark_square / facebook */ horizontal_padding: 20, /* The padding on each side of the picture */ hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */ wmode: 'opaque', /* Set the flash wmode attribute */ autoplay: true, /* Automatically start videos: True/False */ modal: false, /* If set to true, only the close button will close the window */ deeplinking: false, /* Allow prettyPhoto to update the url to enable deeplinking. */ overlay_gallery: true, /* If set to true, a gallery will overlay the fullscreen image on mouse over */ keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */ changepicturecallback: function(){}, /* Called everytime an item is shown/changed */ callback: function(){}, /* Called when prettyPhoto is closed */ ie6_fallback: true, markup: '