1jQuery(document).ready( function($){ 2 "use strict"; 3 4 var $body = $('body'), 5 content_width = $('.content').width(), 6 container_width = $('.container').width(); 7 8 9 /************************* 10 * FEATURES TAB 11 *************************/ 12 13 $.fn.yiw_features_tab = function( options ) { 14 var config = { 15 'tabNav' : 'ul.features-tab-labels', 16 'tabDivs': 'div.features-tab-wrapper' 17 }; 18 19 if( options ) $.extend( config, options ); 20 21 this.each( function () { 22 var tabNav = $( config.tabNav, this ); 23 var tabDivs = $( config.tabDivs, this ); 24 var labelNumber = tabNav.children( 'li' ).length; 25 26 tabDivs.children( 'div' ).hide(); 27 28 var currentDiv = tabDivs.children( 'div' ).eq( tabNav.children( 'li.current-feature' ).index() ); 29 currentDiv.show(); 30 31 $( 'li', tabNav ).hover( function() { 32 if( !$( this ).hasClass( 'current-feature' ) ) { 33 var currentDiv = tabDivs.children( 'div' ).eq( $( this ).index() ); 34 tabNav.children( 'li' ).removeClass( 'current-feature' ); 35 36 $( this ).addClass( 'current-feature' ); 37 38 tabDivs.children( 'div' ).hide().removeClass( 'current-feature' ); console.log('hover'); 39 currentDiv.fadeIn( 'slow', function() { 40 $(document).trigger('feature_tab_opened'); 41 }); 42 } 43 }); 44 45 }); 46 }; 47 48 $( '.features-tab-container' ).yiw_features_tab(); 49 50 /************************* 51 * TABS 52 *************************/ 53 54 $.fn.yiw_tabs = function(options) { 55 // valori di default 56 var config = { 57 'tabNav': 'ul.tabs', 58 'tabDivs': '.containers', 59 'currentClass': 'current' 60 }; 61 62 if (options) $.extend(config, options); 63 64 this.each(function() { 65 var tabNav = $(config.tabNav, this); 66 var tabDivs = $(config.tabDivs, this); 67 var activeTab; 68 var maxHeight = 0; 69 70 tabDivs.children('div').hide(); 71 72 if ( $('li.'+config.currentClass+' a', tabNav).length > 0 ) 73 activeTab = '#' + $('li.'+config.currentClass+' a', tabNav).data('tab'); 74 else 75 activeTab = '#' + $('li:first-child a', tabNav).data('tab'); 76 77 $(activeTab).show().addClass('showing').trigger('yit_tabopened'); 78 $('li:first-child a', tabNav).parents('li').addClass(config.currentClass); 79 80 $('a', tabNav).click(function(){ 81 if ( ! $(this).parents('li').hasClass('current') ) { 82 83 var id = '#' + $(this).data('tab'); 84 var thisLink = $(this); 85 86 $('li.'+config.currentClass, tabNav).removeClass(config.currentClass); 87 $(this).parents('li').addClass(config.currentClass); 88 89 $('.showing', tabDivs).fadeOut(200, function(){ 90 $(this).removeClass('showing').trigger('yit_tabclosed'); 91 $(id).fadeIn(200).addClass('showing').trigger('yit_tabopened'); 92 }); 93 } 94 95 return false; 96 }); 97 98 99 }); 100 }; 101 102 $('.tabs-container').yiw_tabs({ 103 tabNav : 'ul.tabs', 104 tabDivs : '.border-box' 105 }); 106 107 /************************* 108 * IMAGE STYLED 109 *************************/ 110 111 $(window).on('load', function () { 112 if ($.fn.prettyPhoto) { 113 $(".image-styled .img_frame a[rel^='prettyPhoto']").prettyPhoto({ 114 social_tools: '' 115 }); 116 117 118 } 119 }); 120 121 122 123 /************************* 124 * PORTFOLIO SECTION 125 *************************/ 126 127 if ( $.fn.owlCarousel && $.fn.imagesLoaded ) { 128 $('.portfolio-slider').each(function(){ 129 var t = $(this), 130 slides = t.find('.portfolios'), 131 owl = null; 132 133 t.imagesLoaded(function(){ 134 owl = slides.owlCarousel({ 135 items : 5, 136 itemsDesktop: [1199, 4], 137 itemsDesktopSmall: [991, 3], 138 itemsTablet: [767, 2], 139 itemsMobile: [481, 1], 140 addClassActive: true 141 }); 142 }); 143 144 t.on( 'click', '.prev-portfolio', function(e){ 145 e.preventDefault(); 146 owl.trigger('owl.prev'); 147 }); 148 149 t.on( 'click', '.next-portfolio', function(e){ 150 e.preventDefault(); 151 owl.trigger('owl.next'); 152 }); 153 154 155 _onresize( function(){ 156 var active_items = t.find('.owl-item.active').length, 157 slides_number = t.find('.owl-item').length; 158 159 if( slides_number == active_items ) { 160 t.find('.prev-portfolio, .next-portfolio').hide(); 161 }else{ 162 t.find('.prev-portfolio, .next-portfolio').show(); 163 } 164 } ); 165 }); 166 } 167 168 /************************* 169 * FIX WIDTH (sections, google maps, ecc...) 170 *************************/ 171 172 var fixWidth = function(){
173 var wrapperWidth = ( $body.hasClass('boxed-layout') ) ? $('#wrapper').outerWidth() : $(window).width(); 174 175 $('.portfolio-slider, .section-background, .google-map-frame.full-width .inner').css({ 176 width: wrapperWidth 177 }); 178 }; 179 180 _onresize( fixWidth ); 181 fixWidth(); 182 183 184 /************************* 185 * SECTION BACKGROUND 186 *************************/ 187 188 $('.section-background').each( function(){ 189 var section = $(this), 190 section_background_fix_height = function(){ 191 var current_height = section.data('height'); 192 if ( current_height == 0 ){ 193 var row = section.parents('.wpb_row'), 194 parent_height = row.next().height(); 195 196 row.next().css('margin-bottom','25px'); 197 section.css('height', parent_height+60); 198 } 199 }; 200 201 $( window ).on( 'load', section_background_fix_height ); 202 _onresize( section_background_fix_height ); 203 }); 204 205 206 207 /************************* 208 * TEASER 209 *************************/ 210 211 $('.teaser-wrapper').each( function(){ 212 213 var teaser = $(this); 214 215 teaser.imagesLoaded(function() { 216 var teaser_height = teaser.find('.image').height(); 217 teaser.find('.image_banner_inside').css({height: teaser_height}); 218 }); 219 }); 220 221 /************************* 222 * FAQ 223 *************************/ 224 225 $('#faqs-container').yit_faq(); 226 227});
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.