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---------------------------------------------------------------------------------- */ 271jQuery(window).load(function(){ 272 273 // Trigger sticky header on devices wider than 768px 274 if ( jQuery(window).width() > 768 && jQuery( 'body' ).hasClass( 'header-sticky' ) ) { 275 276 // Resize on scroll 277 jQuery(window).scroll(function() { 278 279 // Assign header height and position variables 280 var siteheader_height = jQuery( '#site-header' ).height(); 281 var preheader_height = jQuery( '#pre-header' ).height(); 282 var header_height = jQuery( '#header' ).height(); 283 var header_sticky_offset = jQuery( '#header-sticky' ).offset(); 284 285 // Activate sticky header 100px after header is cleared 286 if ( !jQuery( 'body' ).hasClass( 'header-below' ) ) { 287 if ( header_sticky_offset.top > preheader_height + header_height + 100 ) { 288 jQuery( 'body' ).addClass( 'header-sticky-active' ); 289 } else { 290 jQuery( 'body' ).removeClass( 'header-sticky-active' ); 291 } 292 } else { 293 if ( header_sticky_offset.top > siteheader_height + 100 ) { 294 jQuery( 'body' ).addClass( 'header-sticky-active' ); 295 } else { 296 jQuery( 'body' ).removeClass( 'header-sticky-active' ); 297 } 298 } 299 }); 300 } 301}); 302 303 304/* ---------------------------------------------------------------------------------- 305 FLUID MEDIA SIZES (Modified from http://bavotasan.com/2012/better-way-to-resize-video-using-jquery) 306---------------------------------------------------------------------------------- */ 307 308/* Videos */ 309jQuery(document).ready(function() { 310
311 /* Supported Platforms */ 312 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' ); 313 314 all_videos.each(function() { 315 var el = jQuery(this); 316 el 317 .attr( 'data-aspectRatio', 360 / 640 ) 318 .attr( 'data-oldWidth', el.width() ); 319 } ); 320 321 jQuery(document).ready(function() { 322 all_videos.each( function() { 323 var el = jQuery(this), 324 newWidth = el.parents().width(), 325 oldWidth = el.attr( 'data-oldWidth' ); 326 ratioHeight = el.height() / el.outerHeight(), 327 328 el 329 .removeAttr( 'height' ) 330 .removeAttr( 'width' ) 331 .width( newWidth * ratioHeight ) 332 .outerHeight( newWidth * el.attr( 'data-aspectRatio' ) ); 333 }); 334 }).resize(); 335 336 jQuery(window) 337 .resize( function() { 338 all_videos.each( function() { 339 var el = jQuery(this), 340 newWidth = el.parents().width(), 341 oldWidth = el.attr( 'data-oldWidth' ); 342 ratioHeight = el.height() / el.outerHeight(), 343 344 el 345 .removeAttr( 'height' ) 346 .removeAttr( 'width' ) 347 .width( newWidth * ratioHeight ) 348 .outerHeight( newWidth * el.attr( 'data-aspectRatio' ) ); 349 }); 350 }).resize(); 351}); 352 353/* SoundCloud */ 354jQuery(document).ready(function() { 355 356 /* Supported Platforms */ 357 var all_sounds = jQuery( 'iframe[src^="http://w.soundcloud.com"]' ); 358 359 all_sounds.each(function() { 360 var el = jQuery(this); 361 el 362 .attr( 'data-aspectRatio', el.attr( 'height' ) / el.attr( 'width' ) ) 363 .attr( 'data-oldWidth', el.width() ); 364 }); 365 366 jQuery(document).ready(function() { 367 all_sounds.each( function() { 368 var el = jQuery(this), 369 newWidth = el.parents().width(), 370 oldWidth = el.attr( 'data-oldWidth' ); 371 372 el 373 .removeAttr( 'width' ) 374 .width( newWidth ) 375 }); 376 }).resize(); 377 378 jQuery(window) 379 .resize( function() { 380 all_sounds.each( function() { 381 var el = jQuery(this), 382 newWidth = el.parents().width(), 383 oldWidth = el.attr( 'data-oldWidth' ); 384 385 el 386 .removeAttr( 'width' ) 387 .width( newWidth ) 388 }); 389 }).resize(); 390}); 391 392 393/* ---------------------------------------------------------------------------------- 394 ADD PRETTYPHOTO TO PORTFOLIO PAGE 395---------------------------------------------------------------------------------- */ 396 397jQuery(document).ready(function() { 398 jQuery('#container.portfolio-wrapper a').has('img.hover-zoom').addClass('prettyPhoto'); 399 jQuery('#container.portfolio-wrapper a').has('img.hover-zoom').attr('rel','portfolio[gallery]'); 400 jQuery('a.prettyPhoto').has('img').attr('rel','portfolio[gallery]'); 401 jQuery('a.prettyPhoto').prettyPhoto(); 402}); 403 404 405/* ---------------------------------------------------------------------------------- 406 ADD PRETTYPHOTO TO POST IMAGE PAGE 407---------------------------------------------------------------------------------- */ 408 409jQuery(document).ready(function() { 410 jQuery('body.attachment .entry-attachment .attachment a').has('img').addClass('prettyPhoto'); 411 jQuery('a.prettyPhoto').prettyPhoto(); 412}); 413 414 415/* ---------------------------------------------------------------------------------- 416 ADD _BLANK TO OUTGOING LINKS 417---------------------------------------------------------------------------------- */ 418 419jQuery(document).ready(function(){ 420 jQuery('.thinkup_widget_flickr a[href^="http://"], .thinkup_widget_flickr a[href^="https://"]').attr('target','_blank'); 421 jQuery('.thinkup_widget_socialshare a[href^="http://"], .thinkup_widget_socialshare a[href^="https://"]').attr('target','_blank'); 422 jQuery('.thinkup_widget_socialprofiles a[href^="http://"], .thinkup_widget_socialprofiles a[href^="https://"]').attr('target','_blank'); 423 jQuery('#pre-header-social a[href^="http://"], #pre-header-social a[href^="https://"]').attr('target','_blank'); 424 jQuery('#shareicons a[href^="http://"], #shareicons a[href^="https://"]').attr('target','_blank'); 425}); 426 427 428/* ---------------------------------------------------------------------------------- 429 SHORTCODES 430---------------------------------------------------------------------------------- */ 431 432jQuery(window).load(function() { 433 434 /* Accordion - Fix Bootstrap Toggle Issue */ 435 jQuery('.accordion-toggle').click(function() { 436 if(jQuery(this).hasClass('collapsed')) { 437 jQuery(this).closest('.accordion').find('.accordion-toggle').not(this).addClass('collapsed'); 438 } 439 }); 440 441 /* Divider - Scroll To Top */ 442 jQuery('.backtotop').click(function(){ 443 jQuery('html, body').animate({scrollTop:0}, 'slow'); 444 }); 445 446 /* Tooltip - Activate Bootstrap */ 447 jQuery('[data-tip]').each( function() {jQuery(this).tooltip({ placement: jQuery(this).data('tip') }); }); 448 449 /* Blog Post - Carousel (used for identifying if input variable is an integer */ 450 function isNumber(n) { 451 return !isNaN(parseFloat(n)) && isFinite(n); 452 } 453 454 /* Blog Post - Activate CarouFredSel */ 455 jQuery(window).bind( 'load resize', function() { 456 jQuery( '.sc-carousel' ).each( function(i) { 457 458 // Don't run caroufredsel code if the following classes are present. 459 if ( jQuery( this ).hasClass( 'sc-postitem' ) || 460 jQuery( this ).hasClass( 'sc-featured' ) || 461 jQuery( this ).hasClass( 'sc-image' ) ) { 462 return; 463 }; 464
465 var instanceID = 'sc-carousel-' + i; 466 467 jQuery( this ).attr( 'id', instanceID ); 468 469 jQuery( this ).children( 'ul').attr( 'id', instanceID + '-inner' ); 470 471 var show = jQuery( '#' + instanceID + '.sc-carousel' ).data( 'show' ); 472 var scroll = jQuery( '#' + instanceID + '.sc-carousel' ).data( 'scroll' ); 473 var speed = jQuery( '#' + instanceID + '.sc-carousel' ).data( 'speed' ); 474 var effect = jQuery( '#' + instanceID + '.sc-carousel' ).data( 'effect' ); 475 476 if ( show == 0 || isNaN( show ) == true ) show = '3'; 477 if ( scroll == 0 || isNaN( scroll ) == true ) scroll = '1'; 478 if ( speed == 0 ) speed = '500'; 479 if ( effect == 0 ) { 480 effect = '"scroll"'; 481 } else { 482 effect = '"' + effect + '"'; 483 } 484 485 var showItems = show; 486 var scrollItems = scroll; 487 var speedItems = speed; 488 var fxItems = effect; 489 490 var width = jQuery(window).width(); 491 492 if ( jQuery( 'body' ).hasClass( 'layout-responsive' ) ) { 493 if(width <=685) { 494 showItems = 2; 495 if( scrollItems >= 2 ) { 496 scrollItems = 2; 497 } 498 } 499 if(width <=480) { 500 showItems = 1; 501 scrollItems = 1; 502 } 503 } 504 505 // Apply carousel code if needed 506 if ( jQuery( this ).find( '#' + instanceID + '-inner' ).length ) { 507 508 jQuery( this ).find( '#' + instanceID + '-inner' ).carouFredSel({ 509 width: '100%', 510 items : { 511 visible : showItems, 512 minimum : 3, 513 minimum : 3, 514 start: 0 515 }, 516 scroll : { 517 items : scrollItems, 518 fx : fxItems, 519 easing : "swing", 520 duration : speedItems, 521 }, 522 responsive : true, 523 circular : true, 524 infinite : false, 525 auto : false, 526 prev : { 527 button : '#' + instanceID + ' .prev', 528 key : 'left' 529 }, 530 next : { 531 button : '#' + instanceID + ' .next', 532 key : 'right' 533 }, 534 pagination : '#' + instanceID + ' .pagination', 535 onCreate: function () { 536 jQuery(window).bind("load resize", function() { 537 538 // Set height to testimonial carousel elements - All 539 parentWidthTestimonial = jQuery( '#' + instanceID + '.carousel-testimonial li').outerHeight(); 540 jQuery( '#' + instanceID + '.carousel-testimonial' ).height( 'auto' ); 541 jQuery( '#' + instanceID + '.carousel-testimonial .caroufredsel_wrapper' ).css( { 'height': parentWidthTestimonial } ); 542 543 // Set height to testimonial carousel elements - Fix Style 1 544 parentWidthTestimonial_1 = jQuery( '#' + instanceID + '.carousel-testimonial.style1 .caroufredsel_wrapper').outerHeight(); 545 parentWidthTestimonial_2 = jQuery( '#' + instanceID + '.carousel-testimonial.style1 .sc-carousel-thumbs').outerHeight(); 546 547 jQuery( '#' + instanceID + '.carousel-testimonial.style1' ).height( parentWidthTestimonial_1 + parentWidthTestimonial_2 ); 548 jQuery( '#' + instanceID + '.carousel-testimonial.style1 .sc-carousel-thumbs' ).parent().height( parentWidthTestimonial_2 ); 549 }); 550 } 551 }); 552 } 553 554 // Used for adding thumbnails to slider - Currently only for Testimonials slider 555 if ( jQuery( this ).find('.sc-carousel-thumbs').length ) { 556 557 jQuery( this ).find('.sc-carousel-thumbs').carouFredSel({ 558 responsive: true, 559 circular: false, 560 infinite: false, 561 auto: false, 562 prev: '#prev', 563 next: '#next', 564 items: { 565 visible: { 566 min: 2, 567 max: 6 568 }, 569 width: 150, 570 height: 70 571 } 572 }); 573 } 574 575 jQuery( this ).find('.sc-carousel-thumbs a').click(function() { 576 jQuery('#' + instanceID + '-inner').trigger('slideTo', '#' + this.href.split('#').pop() ); 577 jQuery('.sc-carousel-thumbs a').removeClass('selected'); 578 jQuery( this ).addClass('selected'); 579 return false; 580 }); 581 582 // Set carousel container height 583 parentHeight = jQuery( '#' + instanceID + ' li').outerHeight(); 584 jQuery( '#' + instanceID + ' li' ).each(function() { 585 var elementHeight = jQuery(this).height(); 586 parentHeight = elementHeight > parentHeight ? elementHeight : parentHeight; 587 }); 588 589 // Add addition height if carousel thumbnails are showing 590 if( jQuery( '#' + instanceID ).closest('.sc-carousel').find('.sc-carousel-thumbs').length > 0 ) { 591 parentHeightThumb = parentHeight + jQuery( '#' + instanceID ).closest('.sc-carousel').find('.sc-carousel-thumbs').outerHeight(); 592 } else { 593 parentHeightThumb = parentHeight; 594 } 595 596 // Assign height to unique carousel ID (Max used to ensure thumbnail carousel displays correctly) 597 jQuery( '#' + instanceID ).height( Math.max( parentHeight, parentHeightThumb ) ); 598 jQuery( '#' + instanceID + '-inner' ).height( parentHeight ); 599 jQuery( '#' + instanceID + '-inner' ).parent().height( parentHeight ); 600 601 // Set carousel container height to auto if iframe exists in featured images 602 if ( jQuery( '#' + instanceID + ' iframe').length > 0 ) { 603 jQuery( '#' + instanceID ).addClass('carousel-iframe'); 604 } 605 }); 606 607 }).resize(); 608}); 609 610jQuery(document).ready(function() { 611 612 /* Make slider full width if specified */ 613 jQuery( '.rslides-sc' ).each(function( index, element ){ 614 615 jQuery( element ).attr( 'id', 'thinkupbuilder-sliderimage-' + index ); 616 617 // Collect slider parameter values 618 var wide = jQuery( element ).data( 'wide' ); 619
620 // Format row section for full-screen slider 621 if ( wide == 'on' ) { 622 jQuery( element ).closest( '.panel-grid' ).css( 'padding', 0 ); 623 jQuery( element ).closest( '.panel-grid-core' ).css( 'margin', 0 ).css( 'maxWidth', '100%' ); 624 jQuery( element ).closest( '.panel-grid-cell' ).css( 'padding', 0 ); 625 } 626 }); 627 628 /* Make ThinkUpSlider shortcode full width if specified */ 629 jQuery( '.thinkupslider-sc' ).each(function( index, element ){ 630 631 jQuery( element ).attr( 'id', 'thinkupbuilder-thinkupsliderimage-' + index ); 632 633 // Collect slider parameter values 634 var wide = jQuery( element ).data( 'wide' ); 635 636 // Format row section for full-screen slider 637 if ( wide == 'on' ) { 638 jQuery( element ).closest( '.panel-grid' ).css( 'padding', 0 ); 639 jQuery( element ).closest( '.panel-grid-core' ).css( 'margin', 0 ).css( 'maxWidth', '100%' ); 640 jQuery( element ).closest( '.panel-grid-cell' ).css( 'padding', 0 ); 641 } 642 }); 643 644 /* Make image grid full width if specified */ 645 jQuery( '.sc-grid ul' ).each(function( index, element ){ 646 647 // Collect slider parameter values 648 var wide = jQuery( element ).data( 'wide' ); 649 650 // Format row section for full-screen slider 651 if ( wide == 'on' ) { 652 jQuery( element ).closest( '.panel-grid' ).css( 'padding', 0 ); 653 jQuery( element ).closest( '.panel-grid-core' ).css( 'margin', 0 ).css( 'maxWidth', '100%' ); 654 jQuery( element ).closest( '.panel-grid-cell' ).css( 'padding', 0 ); 655 } 656 }); 657}); 658 659 660/* ---------------------------------------------------------------------------------- 661 HEADER SEARCH 662---------------------------------------------------------------------------------- */ 663 664jQuery(document).ready(function() { 665 jQuery('#header-search a').click(function() { 666 if ( ! jQuery( '#header-search' ).hasClass( 'active' ) ) { 667 jQuery( '#header-search' ).addClass( 'active' ); 668 } else { 669 jQuery( '#header-search' ).removeClass( 'active' ); 670 } 671 }); 672}); 673 674 675/* ---------------------------------------------------------------------------------- 676 SCROLL TO TOP BUTTON 677---------------------------------------------------------------------------------- */ 678 679jQuery(document).ready(function() { 680 if ( jQuery( 'body' ).hasClass( 'scrollup-on' ) ) { 681 (function($) { 682 $(function () { 683 $.scrollUp({ 684 scrollName: 'scrollUp', // Element ID 685 scrollText: '', // Text for element, can contain HTML 686 }); 687 }); 688 } (jQuery) ); 689 } 690}); 691 692 693/* ---------------------------------------------------------------------------------- 694 SUB-FOOTER WIDGETS - CLOSE BUTTON 695---------------------------------------------------------------------------------- */ 696 697// Sub-Footer Widget - Close Button 698jQuery('#sub-footer-close-core').click(function() { 699 if(jQuery( this ).hasClass('collapsed')) { 700 jQuery( this ).removeClass('collapsed'); 701 jQuery( '#sub-footer-widgets' ).removeClass('collapsed'); 702 } else { 703 jQuery( this ).addClass('collapsed'); 704 jQuery( '#sub-footer-widgets' ).addClass('collapsed'); 705 } 706}); 707 708 709/* ---------------------------------------------------------------------------------- 710 SLIDER ICON - SMOOTH SCROLL 711---------------------------------------------------------------------------------- */ 712 713jQuery(document).ready(function (){ 714 715 // Add #thinkupslider-after 716 if ( jQuery( '.featured-icon' ) ) { 717 jQuery( '#slider' ).after( '<div id="thinkupslider-after"></div>' ); 718 } 719 720 // Scroll To #thinkupslider-after 721 jQuery('.featured-icon a').click(function(e){ 722 e.preventDefault(); 723 jQuery('html, body').animate( { scrollTop: jQuery( '#thinkupslider-after' ).offset().top }, 1000 ); 724 }); 725}); 726 727 728/* ---------------------------------------------------------------------------------- 729 WOOCOMMERCE - SOCIAL SHARING 730---------------------------------------------------------------------------------- */ 731 732jQuery(document).ready(function (){ 733 734 // Add active class to social sharing button 735 jQuery('.woo-share').click(function(e){ 736 737 if ( jQuery( this ).hasClass( 'active' ) ) { 738 jQuery( this ).removeClass( 'active' ); 739 jQuery( this ).closest( '.woo-meta' ).find( '.woo-meta-social' ).removeClass( 'active' ); 740 } else { 741 jQuery( this ).addClass( 'active' ); 742 jQuery( this ).closest( '.woo-meta' ).find( '.woo-meta-social' ).addClass( 'active' ); 743 } 744 }); 745});
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.