(function($){ $(function() { $('ul.sf-menu').superfish({ autoArrows: true }); }); /*-----------------------------------------------------------------------------------*/ /* Tabs /*-----------------------------------------------------------------------------------*/ if(jQuery() .tabs) { $( "#tabs" ).tabs().addClass( "ui-tabs-vertical ui-helper-clearfix" ); $( "#tabs li" ).removeClass( "ui-corner-top" ).addClass( "ui-corner-left" ); $( "#tabs" ).tabs({ fx: { opacity: 'toggle' } }); }; /*-----------------------------------------------------------------------------------*/ /* Pretty Photo /*-----------------------------------------------------------------------------------*/ $(function(){ $("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: false, /* 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: true, /* 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 }); }); /*-----------------------------------------------------------------------------------*/ /* Hover Effects /*-----------------------------------------------------------------------------------*/ function hover_overlay() { jQuery('.hover img, .image-grid .hover, .hover img.alignleft, .hover img.alignright').hover( function() { jQuery(this).stop().animate({opacity : 0.5}, 1000); }, function() { jQuery(this).stop().animate({opacity : 1}, 1000); }); } hover_overlay(); /*-----------------------------------------------------------------------------------*/ /* Galleriffic Slider /*-----------------------------------------------------------------------------------*/ if(jQuery() .galleriffic) { // We only want these styles applied when javascript is enabled $('div.content').css('display', 'block'); // Initially set opacity on thumbs and add // additional styling for hover effect on thumbs var onMouseOutOpacity = 0.67; $('#thumbs ul.thumbs li, div.navigation a.pageLink').opacityrollover({ mouseOutOpacity: onMouseOutOpacity, mouseOverOpacity: 1.0, fadeSpeed: 'fast', exemptionSelector: '.selected' }); // Initialize Advanced Galleriffic Gallery var gallery = $('#thumbs').galleriffic({ delay: 3500, numThumbs: 3, preloadAhead: 3, enableTopPager: false, enableBottomPager: false, imageContainerSel: '#slideshow', controlsContainerSel: '#controls', captionContainerSel: '#caption', loadingContainerSel: '#loading', renderSSControls: true, renderNavControls: true, playLinkText: 'Play Slideshow', pauseLinkText: 'Pause Slideshow', prevLinkText: '‹ Previous Photo', nextLinkText: 'Next Photo ›', nextPageLinkText: 'Next ›', prevPageLinkText: '‹ Prev', enableHistory: true, enableKeyboardNavigation: false, autoStart: true, syncTransitions: true, defaultTransitionDuration: 1500, onSlideChange: function(prevIndex, nextIndex) { // 'this' refers to the gallery, which is an extension of $('#thumbs') this.find('ul.thumbs').children() .eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end() .eq(nextIndex).fadeTo('fast', 1.0); // Update the photo index display this.$captionContainer.find('div.photo-index') .html('Photo '+ (nextIndex+1) +' of '+ this.data.length); }, onPageTransitionOut: function(callback) { this.fadeTo('fast', 0.0, callback); }, onPageTransitionIn: function() { var prevPageLink = this.find('a.prev').css('visibility', 'hidden'); var nextPageLink = this.find('a.next').css('visibility', 'hidden'); // Show appropriate next / prev page links if (this.displayedPage > 0) prevPageLink.css('visibility', 'visible'); var lastPage = this.getNumPages() - 1; if (this.displayedPage < lastPage) nextPageLink.css('visibility', 'visible'); this.fadeTo('fast', 1.0); } }); /**************** Event handlers for custom next / prev page links **********************/ gallery.find('a.prev').click(function(e) { gallery.previousPage(); e.preventDefault(); }); gallery.find('a.next').click(function(e) { gallery.nextPage(); e.preventDefault(); }); /****************************************************************************************/ /**** Functions to support integration of galleriffic with the jquery.history plugin ****/ // PageLoad function // This function is called when: // 1. after calling $.historyInit(); // 2. after calling $.historyLoad(); // 3. after pushing "Go Back" button of a browser function pageload(hash) { // alert("pageload: " + hash); // hash doesn't contain the first # character. if(hash) { $.galleriffic.gotoImage(hash); } else { gallery.gotoIndex(0); } } // Initialize history plugin. // The callback is called at once by present location.hash. $.historyInit(pageload, "advanced.html"); // set onlick event for buttons using the jQuery 1.3 live method $("a[rel='history']").live('click', function(e) { if (e.button != 0) return true; var hash = this.href; hash = hash.replace(/^.*#/, ''); // moves to a new page. // pageload is called at once. // hash don't contain "#", "?" $.historyLoad(hash); return false; }); }; /*-----------------------------------------------------------------------------------*/ /* Portfolio li Active Effect /*-----------------------------------------------------------------------------------*/ jQuery('.splitter a').each( function () { jQuery(this).click( function(e) { jQuery('.splitter a').removeClass('active'); jQuery(this).addClass('active'); e.preventDefault(); } ); } ); /*-----------------------------------------------------------------------------------*/ /* Isotope /*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/ /* jQuery Isotope /*-----------------------------------------------------------------------------------*/ if(jQuery().isotope) { var $selector = '*'; jQuery(window).load(function($){ var $container = jQuery('div.isotopecontainer'); $container.each(function($) { var $this = jQuery(this), columnNumber = $this.attr('data-value'), isoBrick = jQuery('.isobrick'), $colnum2; isoBrick.css({ 'margin-left': 0, 'margin-right': 0 }); /* Calculate column number */ /*====================================*/ if ($this.width() < 500 ) { $colnum2 = 2; } else { $colnum2 = columnNumber; } /* Call Isotope with selected Columns */ /*====================================*/ if (columnNumber != '1') { $this.isotope({ masonry: { columnWidth: $this.width() / $colnum2 }, itemSelector : '.isobrick', layoutMode : 'masonry' }); } /* Run Isotope on Resize Event */ /*=============================*/ jQuery(window).resize(function () { if ($this.width() < 500 ) { $colnum2 = 2; } else { $colnum2 = columnNumber; } if (columnNumber != '1') { /* Resize Isotope Container */ $this.isotope({ // update columnWidth to a percentage of container width masonry: { columnWidth: $this.width() / $colnum2 }, itemSelector : '.isobrick', layoutMode : 'masonry' }); } }); /* Filter when link is clicked */ /*=============================*/ jQuery('#filters a, a.filtersort').click(function(){ jQuery('#filters a').removeClass("active"); $selector = jQuery(this).attr('data-value'); jQuery('#filters a').each(function() { $filterselect = jQuery(this).attr('data-value'); if ($filterselect == $selector){ jQuery(this).addClass("active"); } }); if ($selector != '*') { $selector = '.' + $selector; } console.log($selector); $this.isotope({ filter: $selector }); return false; }); }); // End Each }); // End Window Load } // if isotope /*-----------------------------------------------------------------------------------*/ /* Coda Slider /*-----------------------------------------------------------------------------------*/ if(jQuery() .codaSlider){ $('#coda-slider-1').codaSlider({ dynamicArrows: false, dynamicTabs: false }); }; /*-----------------------------------------------------------------------------------*/ /* Form Validation /*-----------------------------------------------------------------------------------*/ $(document).ready(function(){ $("#contactform").validate(); $("#quoteform").validate(); $("#quickform").validate(); }); })(jQuery);