1/** 2/** 3 * Wordpress Front End Enhancements. 4 * 5 * jQuery effects used in theme. 6 */ 7 8// ---------------------------------------------------------------------------------- 9// FORMAT FOOTER LAYOUT 10// ---------------------------------------------------------------------------------- 11jQuery(document).ready(function(){ 12 13 jQuery('#footer-core .widget-area:last-child').addClass("last"); 14 15 // Footer - Footer Widgets Layout (Options 1 - 6) 16 jQuery('#footer-core.option2 .widget-area').addClass("one_half"); 17 jQuery('#footer-core.option3 .widget-area').addClass("one_third"); 18 jQuery('#footer-core.option4 .widget-area').addClass("one_fourth"); 19 jQuery('#footer-core.option5 .widget-area').addClass("one_fifth"); 20 jQuery('#footer-core.option6 .widget-area').addClass("one_sixth"); 21 22 // Footer - Footer Widgets Layout (Option 7) 23 jQuery('#footer-core.option7 #footer-col1.widget-area').addClass("one_third"); 24 jQuery('#footer-core.option7 #footer-col2.widget-area').addClass("two_third"); 25 26 // Footer - Footer Widgets Layout (Option 8) 27 jQuery('#footer-core.option8 #footer-col1.widget-area').addClass("two_third"); 28 jQuery('#footer-core.option8 #footer-col2.widget-area').addClass("one_third"); 29 30 // Footer - Footer Widgets Layout (Option 9) 31 jQuery('#footer-core.option9 #footer-col1.widget-area').addClass("one_fourth"); 32 jQuery('#footer-core.option9 #footer-col2.widget-area').addClass("three_fourth"); 33 34 // Footer - Footer Widgets Layout (Option 10) 35 jQuery('#footer-core.option10 #footer-col1.widget-area').addClass("three_fourth"); 36 jQuery('#footer-core.option10 #footer-col2.widget-area').addClass("one_fourth"); 37 38 // Footer - Footer Widgets Layout (Option 11) 39 jQuery('#footer-core.option11 #footer-col1.widget-area').addClass("one_fifth"); 40 jQuery('#footer-core.option11 #footer-col2.widget-area').addClass("four_fifth"); 41 42 // Footer - Footer Widgets Layout (Option 12) 43 jQuery('#footer-core.option12 #footer-col1.widget-area').addClass("four_fifth"); 44 jQuery('#footer-core.option12 #footer-col2.widget-area').addClass("one_fifth"); 45 46 // Footer - Footer Widgets Layout (Option 13) 47 jQuery('#footer-core.option13 #footer-col1.widget-area').addClass("one_sixth"); 48 jQuery('#footer-core.option13 #footer-col2.widget-area').addClass("one_sixth"); 49 jQuery('#footer-core.option13 #footer-col3.widget-area').addClass("one_sixth"); 50 jQuery('#footer-core.option13 #footer-col4.widget-area').addClass("one_half"); 51 52 // Footer - Footer Widgets Layout (Option 14) 53 jQuery('#footer-core.option14 #footer-col1.widget-area').addClass("one_half"); 54 jQuery('#footer-core.option14 #footer-col2.widget-area').addClass("one_sixth"); 55 jQuery('#footer-core.option14 #footer-col3.widget-area').addClass("one_sixth"); 56 jQuery('#footer-core.option14 #footer-col4.widget-area').addClass("one_sixth"); 57 58 // Footer - Footer Widgets Layout (Option 15) 59 jQuery('#footer-core.option15 #footer-col1.widget-area').addClass("one_sixth"); 60 jQuery('#footer-core.option15 #footer-col2.widget-area').addClass("one_third"); 61 jQuery('#footer-core.option15 #footer-col3.widget-area').addClass("one_half"); 62 63 // Footer - Footer Widgets Layout (Option 16) 64 jQuery('#footer-core.option16 #footer-col1.widget-area').addClass("one_half"); 65 jQuery('#footer-core.option16 #footer-col2.widget-area').addClass("one_third"); 66 jQuery('#footer-core.option16 #footer-col3.widget-area').addClass("one_sixth"); 67 68 // Footer - Footer Widgets Layout (Option 17) 69 jQuery('#footer-core.option17 #footer-col1.widget-area').addClass("one_fourth"); 70 jQuery('#footer-core.option17 #footer-col2.widget-area').addClass("one_fourth"); 71 jQuery('#footer-core.option17 #footer-col3.widget-area').addClass("one_sixth"); 72 jQuery('#footer-core.option17 #footer-col4.widget-area').addClass("one_sixth"); 73 jQuery('#footer-core.option17 #footer-col5.widget-area').addClass("one_sixth"); 74 75 // Footer - Footer Widgets Layout (Option 18) 76 jQuery('#footer-core.option18 #footer-col1.widget-area').addClass("one_sixth"); 77 jQuery('#footer-core.option18 #footer-col2.widget-area').addClass("one_sixth"); 78 jQuery('#footer-core.option18 #footer-col3.widget-area').addClass("one_sixth"); 79 jQuery('#footer-core.option18 #footer-col4.widget-area').addClass("one_fourth"); 80 jQuery('#footer-core.option18 #footer-col5.widget-area').addClass("one_fourth"); 81}); 82 83 84// ---------------------------------------------------------------------------------- 85// FORMAT SUB-FOOTER LAYOUT 86// ---------------------------------------------------------------------------------- 87jQuery(document).ready(function(){ 88 89 jQuery('#sub-footer-widgets .widget-area:last-child').addClass("last"); 90 jQuery('#sub-footer-widgets .widget-area:last-child').after( '<div class="clearboth"></div>' ); 91 92 // Footer - Footer Widgets Layout (Option 2) 93 jQuery('#sub-footer-widgets.option2 .widget-area').addClass("one_half"); 94 95 // Footer - Footer Widgets Layout (Option 3) 96 jQuery('#sub-footer-widgets.option3 #sub-footer-col1.widget-area').addClass("one_third"); 97 jQuery('#sub-footer-widgets.option3 #sub-footer-col2.widget-area').addClass("two_third"); 98 99 // Footer - Footer Widgets Layout (Option 4) 100 jQuery('#sub-footer-widgets.option4 #sub-footer-col1.widget-area').addClass("two_third"); 101 jQuery('#sub-footer-widgets.option4 #sub-footer-col2.widget-area').addClass("one_third"); 102 103 // Footer - Footer Widgets Layout (Option 5) 104 jQuery('#sub-footer-widgets.option5 #sub-footer-col1.widget-area').addClass("one_fourth"); 105 jQuery('#sub-footer-widgets.option5 #sub-footer-col2.widget-area').addClass("three_fourth"); 106 107 // Footer - Footer Widgets Layout (Option 6) 108 jQuery('#sub-footer-widgets.option6 #sub-footer-col1.widget-area').addClass("three_fourth"); 109 jQuery('#sub-footer-widgets.option6 #sub-footer-col2.widget-area').addClass("one_fourth"); 110 111 // Footer - Footer Widgets Layout (Option 7) 112 jQuery('#sub-footer-widgets.option7 #sub-footer-col1.widget-area').addClass("one_fifth"); 113 jQuery('#sub-footer-widgets.option7 #sub-footer-col2.widget-area').addClass("four_fifth"); 114 115 // Footer - Footer Widgets Layout (Option 8) 116 jQuery('#sub-footer-widgets.option8 #sub-footer-col1.widget-area').addClass("four_fifth"); 117 jQuery('#sub-footer-widgets.option8 #sub-footer-col2.widget-area').addClass("one_fifth"); 118}); 119 120 121// ---------------------------------------------------------------------------------- 122// MASONRY - LOAD AFTER IMAGES HAVE LOADED 123// ---------------------------------------------------------------------------------- 124 125jQuery(document).ready(function() { 126 127 // Call imagedLoaded for Masonry if imagedLoaded function is available 128 (function ( $ ) { 129 if ( $.isFunction($.fn.imagesLoaded) ) { 130 131 // Different target for masonry on portfolio pages than any other page 132 if ( $( '#container' ).hasClass( 'portfolio-wrapper' ) ) { 133 var $container = $('#container-inner'); 134 } else if ( $( 'body' ).hasClass( 'woo-shop-grid' ) ) { 135 var $container = $('#main-core .products'); 136 } else { 137 var $container = $('#container'); 138 } 139 140 $container.imagesLoaded( function() { 141 if ( $.isFunction($.fn.masonry) ) { 142 $container.masonry(); 143 } 144 }); 145 } 146 }( jQuery ));
147}); 148 149 150// ---------------------------------------------------------------------------------- 151// FORMAT MAIN HEADER MENU 152// ---------------------------------------------------------------------------------- 153 154function mainmenu(){ 155 156 // Add menu-hover class 157 jQuery("header .header-links ul.menu > li").hover(function(){ 158 jQuery(this).find('ul.sub-menu:first').parent().addClass('menu-hover'); 159 },function(){ 160 jQuery(this).find('ul.sub-menu:first').parent().removeClass('menu-hover'); 161 }); 162 163 // Add menu-parent class 164 jQuery("header .header-links ul.menu > li").each(function(){ 165 jQuery(this).find('ul.sub-menu').parent().addClass('menu-parent'); 166 }); 167 168 // Correct menu for below header when navigating down page. 169 if( jQuery( 'body' ).hasClass( 'header-below' ) ) { 170 jQuery('#header').waypoint(function(direction) { 171 if (direction === 'down') { 172 jQuery( 'body' ).addClass( 'header-below2' ); 173 jQuery( 'body' ).removeClass( 'header-below1' ); 174 } 175 else { 176 jQuery( 'body' ).removeClass( 'header-below2' ); 177 jQuery( 'body' ).addClass( 'header-below1' ); 178 } 179 }, { 180 offset: '50%' 181 }); 182 } 183} 184jQuery(document).ready(function(){ 185 mainmenu(); 186}); 187 188 189// ---------------------------------------------------------------------------------- 190// RESPONSIVE MENU - TOGGLE DROPDOWN 191// ---------------------------------------------------------------------------------- 192 193jQuery(document).ready(function (){ 194 195 // Assign selector variables 196 const headernav_btn = jQuery('#header-nav .btn-navbar'); 197 const header_responsive_inner = jQuery('#header-responsive-inner'); 198 const header_responsive_links = jQuery('#header-responsive .responsive-links'); 199 200 // Open menu 201 headernav_btn.click(function(e){ 202 header_responsive_links.toggleClass( 'nav-open' ); 203 }); 204 205 // Close menu when exiting using keyboard tab 206 header_responsive_inner.on('focusout', function (e) { 207 208 // Get tabbed element 209 const next = e.relatedTarget; 210 211 // Exit if invalid element 212 if( !next ) return; 213 214 // Do not close if tabbing back to toggle 215 if( headernav_btn.is(next) ) return; 216 217 // Close menu if tabbing out to main content area 218 if( ! header_responsive_inner.has(next).length ) { 219 headernav_btn.click(); 220 } 221 }); 222}); 223 224 225// ---------------------------------------------------------------------------------- 226// RESPONSIVE MENU - TOGGLE SUB MENUS 227// ---------------------------------------------------------------------------------- 228 229jQuery(document).ready(function (){ 230 231 jQuery( '#header-responsive .menu-item-has-children > a' ).after( '<span class="sub-menu-toggle" tabindex="0"></span>' ); 232 233 jQuery( '#header-responsive .menu-item-has-children .sub-menu-toggle' ).click(function(e){ 234 235 var parentmenu = jQuery( this ).closest('.menu-item-has-children'); 236 237 if( parentmenu.hasClass( 'sub-menu-show' ) ) { 238 jQuery( parentmenu ).removeClass('sub-menu-show'); 239 } else { 240 jQuery( parentmenu ).addClass('sub-menu-show'); 241 } 242 243 }); 244 245 // Open navigation menu on enter when focused 246 jQuery( '#header-nav .btn-navbar, #header-responsive .menu-item-has-children .sub-menu-toggle' ).keyup(function(e){ 247 248 // "Enter" button on keyboard has been pressed 249 if( e.keyCode == 13 ) { 250 251 // Trigger click event 252 jQuery( this ).trigger( 'click' ); 253 254 // Add aria-expanded attribute 255 var valueAriaExpanded = jQuery( this ).attr( 'aria-expanded' ); 256 257 // Toggle aria-expanded attribute value 258 if( ! valueAriaExpanded || valueAriaExpanded == 'false' ) { 259 jQuery( this ).attr( 'aria-expanded', 'true' ) 260 } else { 261 jQuery( this ).attr( 'aria-expanded', 'false' ) 262 } 263 } 264 }); 265}); 266 267 268// ---------------------------------------------------------------------------------- 269// STICKY HEADER - ONLY ON SCREENS SMALLER THAN 768px 270// ---------------------------------------------------------------------------------- 271 272jQuery(window).load(function(){ 273 274 // Trigger sticky header on devices wider than 768px 275 if ( jQuery(window).width() > 768 && jQuery( 'body' ).hasClass( 'header-sticky' ) ) { 276 277 // Resize on scroll 278 jQuery(window).scroll(function() { 279 280 // Assign header height and position variables 281 var siteheader_height = jQuery( '#site-header' ).height(); 282 var preheader_height = jQuery( '#pre-header' ).height(); 283 var header_height = jQuery( '#header' ).height(); 284 var header_sticky_offset = jQuery( '#header-sticky' ).offset(); 285 286 // Activate sticky header 100px after header is cleared 287 if ( !jQuery( 'body' ).hasClass( 'header-below' ) ) { 288 if ( header_sticky_offset.top > preheader_height + header_height + 100 ) { 289 jQuery( 'body' ).addClass( 'header-sticky-active' ); 290 } else { 291 jQuery( 'body' ).removeClass( 'header-sticky-active' ); 292 } 293 } else { 294 if ( header_sticky_offset.top > siteheader_height + 100 ) { 295 jQuery( 'body' ).addClass( 'header-sticky-active' ); 296 } else { 297 jQuery( 'body' ).removeClass( 'header-sticky-active' ); 298 } 299 } 300 }); 301 } 302}); 303 304 305// ---------------------------------------------------------------------------------- 306// FLUID MEDIA SIZES (Modified from http://bavotasan.com/2012/better-way-to-resize-video-using-jquery) 307// ---------------------------------------------------------------------------------- 308 309// Videos 310jQuery(document).ready(function() { 311
312 /* Supported Platforms */ 313 var all_videos = jQuery( 'iframe[src*="//player.vimeo.com"], iframe[src*="//www.youtube.com"], iframe[src*="//blip.tv"], iframe[src*="//www.slideshare.net"], iframe[src*="//www.scribd.com"], iframe[src*="//revision3.com"], iframe[src*="//www.hulu.com"], iframe[src*="//www.funnyordie.com"], iframe[src*="//www.dailymotion.com"], iframe[src*="//maps.google.com"], embed[src*="//v.wordpress.com"], object, embed' ); 314 315 all_videos.each(function() { 316 var el = jQuery(this); 317 el 318 .attr( 'data-aspectRatio', 360 / 640 ) 319 .attr( 'data-oldWidth', el.width() ); 320 } ); 321 322 jQuery(document).ready(function() { 323 all_videos.each( function() { 324 var el = jQuery(this), 325 newWidth = el.parents().width(), 326 oldWidth = el.attr( 'data-oldWidth' ); 327 ratioHeight = el.height() / el.outerHeight(), 328 329 el 330 .removeAttr( 'height' ) 331 .removeAttr( 'width' ) 332 .width( newWidth * ratioHeight ) 333 .outerHeight( newWidth * el.attr( 'data-aspectRatio' ) ); 334 }); 335 }).resize(); 336 337 jQuery(window) 338 .resize( function() { 339 all_videos.each( function() { 340 var el = jQuery(this), 341 newWidth = el.parents().width(), 342 oldWidth = el.attr( 'data-oldWidth' ); 343 ratioHeight = el.height() / el.outerHeight(), 344 345 el 346 .removeAttr( 'height' ) 347 .removeAttr( 'width' ) 348 .width( newWidth * ratioHeight ) 349 .outerHeight( newWidth * el.attr( 'data-aspectRatio' ) ); 350 }); 351 }).resize(); 352}); 353 354// SoundCloud 355jQuery(document).ready(function() { 356 357 // Supported Platforms 358 var all_sounds = jQuery( 'iframe[src^="http://w.soundcloud.com"]' ); 359 360 all_sounds.each(function() { 361 var el = jQuery(this); 362 el 363 .attr( 'data-aspectRatio', el.attr( 'height' ) / el.attr( 'width' ) ) 364 .attr( 'data-oldWidth', el.width() ); 365 }); 366 367 jQuery(document).ready(function() { 368 all_sounds.each( function() { 369 var el = jQuery(this), 370 newWidth = el.parents().width(), 371 oldWidth = el.attr( 'data-oldWidth' ); 372 373 el 374 .removeAttr( 'width' ) 375 .width( newWidth ) 376 }); 377 }).resize(); 378 379 jQuery(window) 380 .resize( function() { 381 all_sounds.each( function() { 382 var el = jQuery(this), 383 newWidth = el.parents().width(), 384 oldWidth = el.attr( 'data-oldWidth' ); 385 386 el 387 .removeAttr( 'width' ) 388 .width( newWidth ) 389 }); 390 }).resize(); 391}); 392 393 394// ---------------------------------------------------------------------------------- 395// ADD PRETTYPHOTO TO PORTFOLIO PAGE 396// ---------------------------------------------------------------------------------- 397 398jQuery(document).ready(function() { 399 jQuery('#container.portfolio-wrapper a').has('img.hover-zoom').addClass('prettyPhoto'); 400 jQuery('#container.portfolio-wrapper a').has('img.hover-zoom').attr('rel','portfolio[gallery]'); 401 jQuery('a.prettyPhoto').has('img').attr('rel','portfolio[gallery]'); 402 jQuery('a.prettyPhoto').prettyPhoto(); 403}); 404 405 406// ---------------------------------------------------------------------------------- 407// ADD PRETTYPHOTO TO POST IMAGE PAGE 408// ---------------------------------------------------------------------------------- 409 410jQuery(document).ready(function() { 411 jQuery('body.attachment .entry-attachment .attachment a').has('img').addClass('prettyPhoto'); 412 jQuery('a.prettyPhoto').prettyPhoto(); 413}); 414 415 416// ---------------------------------------------------------------------------------- 417// ADD _BLANK TO OUTGOING LINKS 418// ---------------------------------------------------------------------------------- 419 420jQuery(document).ready(function(){ 421 jQuery('.shuttle_widget_flickr a[href^="http://"], .shuttle_widget_flickr a[href^="https://"]').attr('target','_blank'); 422 jQuery('.shuttle_widget_socialshare a[href^="http://"], .shuttle_widget_socialshare a[href^="https://"]').attr('target','_blank'); 423 jQuery('.shuttle_widget_socialprofiles a[href^="http://"], .shuttle_widget_socialprofiles a[href^="https://"]').attr('target','_blank'); 424 jQuery('#pre-header-social a[href^="http://"], #pre-header-social a[href^="https://"]').attr('target','_blank'); 425 jQuery('#shareicons a[href^="http://"], #shareicons a[href^="https://"]').attr('target','_blank'); 426}); 427 428 429// ---------------------------------------------------------------------------------- 430// SHORTCODES 431// ---------------------------------------------------------------------------------- 432 433jQuery(window).load(function() { 434 435 // Accordion - Fix Bootstrap Toggle Issue 436 jQuery('.accordion-toggle').click(function() { 437 if(jQuery(this).hasClass('collapsed')) { 438 jQuery(this).closest('.accordion').find('.accordion-toggle').not(this).addClass('collapsed'); 439 } 440 }); 441 442 // Divider - Scroll To Top 443 jQuery('.backtotop').click(function(){ 444 jQuery('html, body').animate({scrollTop:0}, 'slow'); 445 }); 446 447 // Tooltip - Activate Bootstrap 448 jQuery('[data-tip]').each( function() {jQuery(this).tooltip({ placement: jQuery(this).data('tip') }); }); 449 450 // Blog Post - Carousel (used for identifying if input variable is an integer 451 function isNumber(n) { 452 return !isNaN(parseFloat(n)) && isFinite(n); 453 } 454 455 // Blog Post - Activate CarouFredSel 456 jQuery(window).bind( 'load resize', function() { 457 jQuery( '.sc-carousel' ).each( function(i) { 458 459 // Don't run caroufredsel code if the following classes are present. 460 if ( jQuery( this ).hasClass( 'sc-postitem' ) || 461 jQuery( this ).hasClass( 'sc-featured' ) || 462 jQuery( this ).hasClass( 'sc-image' ) ) { 463 return; 464 }; 465
466 var instanceID = 'sc-carousel-' + i; 467 468 jQuery( this ).attr( 'id', instanceID ); 469 470 jQuery( this ).children( 'ul').attr( 'id', instanceID + '-inner' ); 471 472 var show = jQuery( '#' + instanceID + '.sc-carousel' ).data( 'show' ); 473 var scroll = jQuery( '#' + instanceID + '.sc-carousel' ).data( 'scroll' ); 474 var speed = jQuery( '#' + instanceID + '.sc-carousel' ).data( 'speed' ); 475 var effect = jQuery( '#' + instanceID + '.sc-carousel' ).data( 'effect' ); 476 477 if ( show == 0 || isNaN( show ) == true ) show = '3'; 478 if ( scroll == 0 || isNaN( scroll ) == true ) scroll = '1'; 479 if ( speed == 0 ) speed = '500'; 480 if ( effect == 0 ) { 481 effect = '"scroll"'; 482 } else { 483 effect = '"' + effect + '"'; 484 } 485 486 var showItems = show; 487 var scrollItems = scroll; 488 var speedItems = speed; 489 var fxItems = effect; 490 491 var width = jQuery(window).width(); 492 493 if ( jQuery( 'body' ).hasClass( 'layout-responsive' ) ) { 494 if(width <=685) { 495 showItems = 2; 496 if( scrollItems >= 2 ) { 497 scrollItems = 2; 498 } 499 } 500 if(width <=480) { 501 showItems = 1; 502 scrollItems = 1; 503 } 504 } 505 506 // Apply carousel code if needed 507 if ( jQuery( this ).find( '#' + instanceID + '-inner' ).length ) { 508 509 jQuery( this ).find( '#' + instanceID + '-inner' ).carouFredSel({ 510 width: '100%', 511 items : { 512 visible : showItems, 513 minimum : 3, 514 minimum : 3, 515 start: 0 516 }, 517 scroll : { 518 items : scrollItems, 519 fx : fxItems, 520 easing : "swing", 521 duration : speedItems, 522 }, 523 responsive : true, 524 circular : true, 525 infinite : false, 526 auto : false, 527 prev : { 528 button : '#' + instanceID + ' .prev', 529 key : 'left' 530 }, 531 next : { 532 button : '#' + instanceID + ' .next', 533 key : 'right' 534 }, 535 pagination : '#' + instanceID + ' .pagination', 536 onCreate: function () { 537 jQuery(window).bind("load resize", function() { 538 539 // Set height to testimonial carousel elements - All 540 parentWidthTestimonial = jQuery( '#' + instanceID + '.carousel-testimonial li').outerHeight(); 541 jQuery( '#' + instanceID + '.carousel-testimonial' ).height( 'auto' ); 542 jQuery( '#' + instanceID + '.carousel-testimonial .caroufredsel_wrapper' ).css( { 'height': parentWidthTestimonial } ); 543 544 // Set height to testimonial carousel elements - Fix Style 1 545 parentWidthTestimonial_1 = jQuery( '#' + instanceID + '.carousel-testimonial.style1 .caroufredsel_wrapper').outerHeight(); 546 parentWidthTestimonial_2 = jQuery( '#' + instanceID + '.carousel-testimonial.style1 .sc-carousel-thumbs').outerHeight(); 547 548 jQuery( '#' + instanceID + '.carousel-testimonial.style1' ).height( parentWidthTestimonial_1 + parentWidthTestimonial_2 ); 549 jQuery( '#' + instanceID + '.carousel-testimonial.style1 .sc-carousel-thumbs' ).parent().height( parentWidthTestimonial_2 ); 550 }); 551 } 552 }); 553 } 554 555 // Used for adding thumbnails to slider - Currently only for Testimonials slider 556 if ( jQuery( this ).find('.sc-carousel-thumbs').length ) { 557 558 jQuery( this ).find('.sc-carousel-thumbs').carouFredSel({ 559 responsive: true, 560 circular: false, 561 infinite: false, 562 auto: false, 563 prev: '#prev', 564 next: '#next', 565 items: { 566 visible: { 567 min: 2, 568 max: 6 569 }, 570 width: 150, 571 height: 70 572 } 573 }); 574 } 575 576 jQuery( this ).find('.sc-carousel-thumbs a').click(function() { 577 jQuery('#' + instanceID + '-inner').trigger('slideTo', '#' + this.href.split('#').pop() ); 578 jQuery('.sc-carousel-thumbs a').removeClass('selected'); 579 jQuery( this ).addClass('selected'); 580 return false; 581 }); 582 583 // Set carousel container height 584 parentHeight = jQuery( '#' + instanceID + ' li').outerHeight(); 585 jQuery( '#' + instanceID + ' li' ).each(function() { 586 var elementHeight = jQuery(this).height(); 587 parentHeight = elementHeight > parentHeight ? elementHeight : parentHeight; 588 }); 589 590 // Add addition height if carousel thumbnails are showing 591 if( jQuery( '#' + instanceID ).closest('.sc-carousel').find('.sc-carousel-thumbs').length > 0 ) { 592 parentHeightThumb = parentHeight + jQuery( '#' + instanceID ).closest('.sc-carousel').find('.sc-carousel-thumbs').outerHeight(); 593 } else { 594 parentHeightThumb = parentHeight; 595 } 596 597 // Assign height to unique carousel ID (Max used to ensure thumbnail carousel displays correctly) 598 jQuery( '#' + instanceID ).height( Math.max( parentHeight, parentHeightThumb ) ); 599 jQuery( '#' + instanceID + '-inner' ).height( parentHeight ); 600 jQuery( '#' + instanceID + '-inner' ).parent().height( parentHeight ); 601 602 // Set carousel container height to auto if iframe exists in featured images 603 if ( jQuery( '#' + instanceID + ' iframe').length > 0 ) { 604 jQuery( '#' + instanceID ).addClass('carousel-iframe'); 605 } 606 }); 607 608 }).resize(); 609 610 // Progress Bar - Animate Width 611 jQuery('.progress').waypoint( 612 function(event, direction) { 613 614 var width = jQuery(this).children().attr('data-width');
615 var delay = jQuery(this).children().attr('data-delay'); 616 617 jQuery(this).delay( delay ).queue(function(next){ 618 jQuery(this).children().css( 'width', width + '%' ); 619 }); 620 }, { 621 offset: 'bottom-in-view' 622 }); 623}); 624 625jQuery(document).ready(function() { 626 627 // Make slider full width if specified 628 jQuery( '.rslides-sc' ).each(function( index, element ){ 629 630 jQuery( element ).attr( 'id', 'shuttlebuilder-sliderimage-' + index ); 631 632 // Collect slider parameter values 633 var wide = jQuery( element ).data( 'wide' ); 634 635 // Format row section for full-screen slider 636 if ( wide == 'on' ) { 637 jQuery( element ).closest( '.panel-grid' ).css( 'padding', 0 ); 638 jQuery( element ).closest( '.panel-grid-core' ).css( 'margin', 0 ).css( 'maxWidth', '100%' ); 639 jQuery( element ).closest( '.panel-grid-cell' ).css( 'padding', 0 ); 640 } 641 }); 642 643 // Make ShuttleSlider shortcode full width if specified 644 jQuery( '.shuttleslider-sc' ).each(function( index, element ){ 645 646 jQuery( element ).attr( 'id', 'shuttlebuilder-shuttlesliderimage-' + index ); 647 648 // Collect slider parameter values 649 var wide = jQuery( element ).data( 'wide' ); 650 651 // Format row section for full-screen slider 652 if ( wide == 'on' ) { 653 jQuery( element ).closest( '.panel-grid' ).css( 'padding', 0 ); 654 jQuery( element ).closest( '.panel-grid-core' ).css( 'margin', 0 ).css( 'maxWidth', '100%' ); 655 jQuery( element ).closest( '.panel-grid-cell' ).css( 'padding', 0 ); 656 } 657 }); 658 659 // Make image grid full width if specified 660 jQuery( '.sc-grid ul' ).each(function( index, element ){ 661 662 // Collect slider parameter values 663 var wide = jQuery( element ).data( 'wide' ); 664 665 // Format row section for full-screen slider 666 if ( wide == 'on' ) { 667 jQuery( element ).closest( '.panel-grid' ).css( 'padding', 0 ); 668 jQuery( element ).closest( '.panel-grid-core' ).css( 'margin', 0 ).css( 'maxWidth', '100%' ); 669 jQuery( element ).closest( '.panel-grid-cell' ).css( 'padding', 0 ); 670 } 671 }); 672}); 673 674 675// ---------------------------------------------------------------------------------- 676// SHORTCODES - WAYPOINTS ANIMATION 677// ---------------------------------------------------------------------------------- 678 679jQuery(document).ready(function() { 680 681 jQuery('.anim-start-ltr').waypoint( 682 function(event, direction) { 683 var time = jQuery(this).parent().attr('title'); 684 685 jQuery(this).delay( time ).queue(function(next){ 686 jQuery(this).removeClass( 'anim-start-ltr' ).addClass( 'anim-end-ltr' ); 687 jQuery(this).parent().removeAttr( 'title' ); 688 }); 689 }, { 690 offset: 'bottom-in-view' 691 }); 692 693 jQuery('.anim-start-rtl').waypoint( 694 function(event, direction) { 695 var time = jQuery(this).parent().attr('title'); 696 697 jQuery(this).delay( time ).queue(function(next){ 698 jQuery(this).removeClass( 'anim-start-rtl' ).addClass( 'anim-end-rtl' ); 699 jQuery(this).parent().removeAttr( 'title' ); 700 }); 701 }, { 702 offset: 'bottom-in-view' 703 }); 704 705 jQuery('.anim-start-btt').waypoint( 706 function(event, direction) { 707 var time = jQuery(this).parent().attr('title'); 708 709 jQuery(this).delay( time ).queue(function(next){ 710 jQuery(this).removeClass( 'anim-start-btt' ).addClass( 'anim-end-btt' ); 711 jQuery(this).parent().removeAttr( 'title' ); 712 }); 713 }, { 714 offset: 'bottom-in-view' 715 }); 716 717 jQuery('.anim-start-ttb').waypoint( 718 function(event, direction) { 719 var time = jQuery(this).parent().attr('title'); 720 721 jQuery(this).delay( time ).queue(function(next){ 722 jQuery(this).removeClass( 'anim-start-ttb' ).addClass( 'anim-end-ttb' ); 723 jQuery(this).parent().removeAttr( 'title' ); 724 }); 725 }, { 726 offset: 'bottom-in-view' 727 }); 728 729 jQuery('.anim-start-stb').waypoint( 730 function(event, direction) { 731 var time = jQuery(this).parent().attr('title'); 732 733 jQuery(this).delay( time ).queue(function(next){ 734 jQuery(this).removeClass( 'anim-start-stb' ).addClass( 'anim-end-stb '+ time ); 735 jQuery(this).parent().removeAttr( 'title' ); 736 }); 737 }, { 738 offset: 'bottom-in-view' 739 }); 740 741}); 742 743 744// ---------------------------------------------------------------------------------- 745// HEADER SEARCH 746// ---------------------------------------------------------------------------------- 747 748jQuery(document).ready(function() { 749 jQuery('#header #header-search a').click(function() { 750 if ( ! jQuery( '#header #header-search' ).hasClass( 'active' ) ) { 751 jQuery( '#header #header-search' ).addClass( 'active' ); 752 } else { 753 jQuery( '#header #header-search' ).removeClass( 'active' ); 754 } 755 }); 756 757 jQuery('#header-sticky #header-search a').click(function() { 758 if ( ! jQuery( '#header-sticky #header-search' ).hasClass( 'active' ) ) { 759 jQuery( '#header-sticky #header-search' ).addClass( 'active' ); 760 } else { 761 jQuery( '#header-sticky #header-search' ).removeClass( 'active' ); 762 } 763 }); 764}); 765 766 767// ---------------------------------------------------------------------------------- 768// SCROLL TO TOP BUTTON 769// ---------------------------------------------------------------------------------- 770 771jQuery(document).ready(function() { 772 if ( jQuery( 'body' ).hasClass( 'scrollup-on' ) ) { 773 (function($) { 774 $(function () { 775 $.scrollUp({ 776 scrollName: 'scrollUp', // Element ID 777 scrollText: '', // Text for element, can contain HTML 778 }); 779 }); 780 } (jQuery) ); 781 } 782}); 783 784 785// ---------------------------------------------------------------------------------- 786// SUB-FOOTER WIDGETS - CLOSE BUTTON 787// ---------------------------------------------------------------------------------- 788 789// Sub-Footer Widget - Close Button 790jQuery('#sub-footer-close-core').click(function() { 791 if(jQuery( this ).hasClass('collapsed')) { 792 jQuery( this ).removeClass('collapsed'); 793 jQuery( '#sub-footer-widgets' ).removeClass('collapsed'); 794 } else { 795 jQuery( this ).addClass('collapsed'); 796 jQuery( '#sub-footer-widgets' ).addClass('collapsed'); 797 } 798}); 799 800 801// ---------------------------------------------------------------------------------- 802// SLIDER ICON - SMOOTH SCROLL 803// ---------------------------------------------------------------------------------- 804 805jQuery(document).ready(function (){ 806 807 // Add #shuttleslider-after 808 if ( jQuery( '.featured-icon' ) ) { 809 jQuery( '#slider' ).after( '<div id="shuttleslider-after"></div>' ); 810 } 811 812 // Scroll To #shuttleslider-after 813 jQuery('.featured-icon a').click(function(e){
814 e.preventDefault(); 815 jQuery('html, body').animate( { scrollTop: jQuery( '#shuttleslider-after' ).offset().top }, 1000 ); 816 }); 817}); 818 819 820// ---------------------------------------------------------------------------------- 821// WOOCOMMERCE - SOCIAL SHARING 822// ---------------------------------------------------------------------------------- 823 824jQuery(document).ready(function (){ 825 826 // Add active class to social sharing button 827 jQuery('.woo-share').click(function(e){ 828 829 if ( jQuery( this ).hasClass( 'active' ) ) { 830 jQuery( this ).removeClass( 'active' ); 831 jQuery( this ).closest( '.woo-meta' ).find( '.woo-meta-social' ).removeClass( 'active' ); 832 } else { 833 jQuery( this ).addClass( 'active' ); 834 jQuery( this ).closest( '.woo-meta' ).find( '.woo-meta-social' ).addClass( 'active' ); 835 } 836 }); 837}); 838
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.