1/** 2 * Wordpress Front End Enhancements. 3 * 4 * jQuery effects used in theme. 5 */ 6 7/* ---------------------------------------------------------------------------------- 8 FORMAT FOOTER LAYOUT 9---------------------------------------------------------------------------------- */ 10jQuery(document).ready(function(){ 11 12jQuery('#footer-core .widget-area:last-child').addClass("last"); 13 14/* Footer - Footer Widgets Layout (Options 1 - 6) */ 15jQuery('#footer-core.option2 .widget-area').addClass("one_half"); 16jQuery('#footer-core.option3 .widget-area').addClass("one_third"); 17jQuery('#footer-core.option4 .widget-area').addClass("one_fourth"); 18jQuery('#footer-core.option5 .widget-area').addClass("one_fifth"); 19jQuery('#footer-core.option6 .widget-area').addClass("one_sixth"); 20 21/* Footer - Footer Widgets Layout (Option 7) */ 22jQuery('#footer-core.option7 #footer-col1.widget-area').addClass("one_third"); 23jQuery('#footer-core.option7 #footer-col2.widget-area').addClass("two_third"); 24 25/* Footer - Footer Widgets Layout (Option 8) */ 26jQuery('#footer-core.option8 #footer-col1.widget-area').addClass("two_third"); 27jQuery('#footer-core.option8 #footer-col2.widget-area').addClass("one_third"); 28 29/* Footer - Footer Widgets Layout (Option 9) */ 30jQuery('#footer-core.option9 #footer-col1.widget-area').addClass("one_fourth"); 31jQuery('#footer-core.option9 #footer-col2.widget-area').addClass("three_fourth"); 32 33/* Footer - Footer Widgets Layout (Option 10) */ 34jQuery('#footer-core.option10 #footer-col1.widget-area').addClass("three_fourth"); 35jQuery('#footer-core.option10 #footer-col2.widget-area').addClass("one_fourth"); 36 37/* Footer - Footer Widgets Layout (Option 11) */ 38jQuery('#footer-core.option11 #footer-col1.widget-area').addClass("one_fifth"); 39jQuery('#footer-core.option11 #footer-col2.widget-area').addClass("four_fifth"); 40 41/* Footer - Footer Widgets Layout (Option 12) */ 42jQuery('#footer-core.option12 #footer-col1.widget-area').addClass("four_fifth"); 43jQuery('#footer-core.option12 #footer-col2.widget-area').addClass("one_fifth"); 44 45/* Footer - Footer Widgets Layout (Option 13) */ 46jQuery('#footer-core.option13 #footer-col1.widget-area').addClass("one_sixth"); 47jQuery('#footer-core.option13 #footer-col2.widget-area').addClass("one_sixth"); 48jQuery('#footer-core.option13 #footer-col3.widget-area').addClass("one_sixth"); 49jQuery('#footer-core.option13 #footer-col4.widget-area').addClass("one_half"); 50 51/* Footer - Footer Widgets Layout (Option 14) */ 52jQuery('#footer-core.option14 #footer-col1.widget-area').addClass("one_half"); 53jQuery('#footer-core.option14 #footer-col2.widget-area').addClass("one_sixth"); 54jQuery('#footer-core.option14 #footer-col3.widget-area').addClass("one_sixth"); 55jQuery('#footer-core.option14 #footer-col4.widget-area').addClass("one_sixth"); 56 57/* Footer - Footer Widgets Layout (Option 15) */ 58jQuery('#footer-core.option15 #footer-col1.widget-area').addClass("one_sixth"); 59jQuery('#footer-core.option15 #footer-col2.widget-area').addClass("one_third"); 60jQuery('#footer-core.option15 #footer-col3.widget-area').addClass("one_half"); 61 62/* Footer - Footer Widgets Layout (Option 16) */ 63jQuery('#footer-core.option16 #footer-col1.widget-area').addClass("one_half"); 64jQuery('#footer-core.option16 #footer-col2.widget-area').addClass("one_third"); 65jQuery('#footer-core.option16 #footer-col3.widget-area').addClass("one_sixth"); 66 67/* Footer - Footer Widgets Layout (Option 17) */ 68jQuery('#footer-core.option17 #footer-col1.widget-area').addClass("one_fourth"); 69jQuery('#footer-core.option17 #footer-col2.widget-area').addClass("one_fourth"); 70jQuery('#footer-core.option17 #footer-col3.widget-area').addClass("one_sixth"); 71jQuery('#footer-core.option17 #footer-col4.widget-area').addClass("one_sixth"); 72jQuery('#footer-core.option17 #footer-col5.widget-area').addClass("one_sixth"); 73 74/* Footer - Footer Widgets Layout (Option 18) */ 75jQuery('#footer-core.option18 #footer-col1.widget-area').addClass("one_sixth"); 76jQuery('#footer-core.option18 #footer-col2.widget-area').addClass("one_sixth"); 77jQuery('#footer-core.option18 #footer-col3.widget-area').addClass("one_sixth"); 78jQuery('#footer-core.option18 #footer-col4.widget-area').addClass("one_fourth"); 79jQuery('#footer-core.option18 #footer-col5.widget-area').addClass("one_fourth"); 80}); 81 82 83/* ---------------------------------------------------------------------------------- 84 FORMAT MAIN HEADER MENU 85---------------------------------------------------------------------------------- */ 86function mainmenu(){ 87 88 /* Add menu-hover class */ 89 jQuery("header .header-links ul.menu > li").hover(function(){ 90 jQuery(this).find('ul.sub-menu:first').css({visibility: "visible",display: "none"}).parent().addClass('menu-hover'); 91 },function(){ 92 jQuery(this).find('ul.sub-menu:first').css({visibility: "hidden",display: "none"}).parent().removeClass('menu-hover'); 93 }); 94 95 /* Add menu-parent class */ 96 jQuery("header .header-links ul.menu > li").each(function(){ 97 jQuery(this).find('ul.sub-menu').css({visibility: "visible",display: "none"}).parent().addClass('menu-parent'); 98 }); 99 100 // Change z-index of #pre-header so dropdown menus & tooltips can be seen 101 jQuery("#pre-header").hover(function(){ 102 jQuery( this ).css({ 'z-index' : '999991' }); 103 },function(){ 104 jQuery( this ).css({ 'z-index' : '999' }); 105 }); 106 107 // Add smooth dropdown effect 108 jQuery("header .header-links li").hover(function(){ 109 parentWidth = jQuery(this).width(); 110 // Offset mega menu 111 if(jQuery(this).hasClass('header-thinkupmega')) { 112 megaWidth = jQuery(this).find('ul:first').width(); 113 megaOffset = ( megaWidth - parentWidth ) * -0.5; 114 115 // Ensure mega menu is offset correctly for LTR and RTL languages 116 if(jQuery('body').hasClass('rtl')) { 117 jQuery(this).find('ul:first').css({ 'margin-right' : megaOffset }); 118 } else { 119 jQuery(this).find('ul:first').css({ 'margin-left' : megaOffset }); 120 } 121 122 jQuery(this).find('ul').addClass( 'header-thinkupmegachild' ); 123 } 124 // Prevent sub menus of mega menu from opening / closing 125 if( ! jQuery(this).parent().hasClass('header-thinkupmegachild')) { 126 jQuery(this).find('ul:first').css({visibility: "visible",display: "none","min-width": parentWidth}
126).slideToggle(400); 127 } 128 },function(){ 129 jQuery(this).find('ul:first').css({visibility: "hidden"}); 130 }); 131 132 /* Add <span> to links in pre-header and header sub menus */ 133 jQuery('#pre-header .sub-menu a, #header .sub-menu a').each(function() { 134 jQuery(this).wrapInner("<span></span>"); 135 }); 136} 137jQuery(document).ready(function(){ 138 mainmenu(); 139}); 140 141 142/* ---------------------------------------------------------------------------------- 143 RESPONSIVE MENU - TOGGLE SUB MENUS 144---------------------------------------------------------------------------------- */ 145 146jQuery(document).ready(function (){ 147 148 jQuery( '#header-responsive .menu-item-has-children > a' ).after( '<span class="sub-menu-toggle"></span>' ); 149 150 jQuery( '#header-responsive .menu-item-has-children .sub-menu-toggle' ).click(function(e){ 151 152 var parentmenu = jQuery( this ).closest('.menu-item-has-children'); 153 154 if( parentmenu.hasClass( 'sub-menu-show' ) ) { 155 jQuery( parentmenu ).removeClass('sub-menu-show'); 156 } else { 157 jQuery( parentmenu ).addClass('sub-menu-show'); 158 } 159 160 }); 161}); 162 163 164/* ---------------------------------------------------------------------------------- 165 STICKY HEADER 166---------------------------------------------------------------------------------- */ 167jQuery(window).load(function(){ 168 169 // Trigger sticky header on devices wider than 768px 170 if ( jQuery(window).width() > 768 && jQuery( 'body' ).hasClass( 'header-sticky' ) || 171 jQuery( 'body' ).hasClass( 'header-sticky' ) && jQuery( 'body' ).hasClass( 'layout-fixed' ) ) { 172 173 if(jQuery( 'body' ).hasClass( 'header-style1' )) { 174 // Offset #header for smooth sticky effect 175 headerTop = jQuery( '#pre-header' ).height(); 176 jQuery( '#header' ).animate({'top': headerTop },300 ); 177 178 // Move slide content down by height of #pre-header on home pages 179 if( jQuery( 'body' ).hasClass( 'home' )) { 180 181 // Move slide content down by height of #pre-header on home pages 182 if( jQuery( 'body' ).hasClass( 'slider-boxed' )) { 183 jQuery( '#slider-core' ).animate({'margin-top': headerTop },300 ); 184 } 185 } 186 187 // Add margin to site header so content doesn't get hidden behind header 188 if( ! jQuery( 'body' ).hasClass( 'home' ) && jQuery( '#wpadminbar' ).length == '0' ) { 189 jQuery( '#site-header' ).animate({'margin-bottom': headerTop },300 ); 190 } 191 192 // Trigger sticky on #header 193 if ( ! jQuery( '#header' ).parent().hasClass( 'sticky-done' ) ) { 194 jQuery( '#header' ).sticky( { topSpacing:0 } ); 195 jQuery( '#header-sticky-wrapper' ).addClass( 'sticky-done' ); 196 } 197 198 // Reposition #header smoothly when top of page is reached 199 jQuery(window).scroll(function(){ 200 if(!jQuery(window).scrollTop()) { 201 headerTop = jQuery( '#pre-header' ).height(); 202 jQuery( '#header' ).animate({'top': headerTop },300 ); 203 } 204 }); 205 206 207 } else if(jQuery( 'body' ).hasClass( 'header-style2' )) { 208 jQuery("#header-links").sticky({topSpacing:0}); 209 } 210 } 211}); 212 213 214/* ---------------------------------------------------------------------------------- 215 FLUID MEDIA SIZES (Modified from http://bavotasan.com/2012/better-way-to-resize-video-using-jquery) 216---------------------------------------------------------------------------------- */ 217 218/* Videos */ 219jQuery(document).ready(function() { 220 221 /* Supported Platforms */ 222 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' ); 223 224 all_videos.each(function() { 225 var el = jQuery(this); 226 el 227 .attr( 'data-aspectRatio', 360 / 640 ) 228 .attr( 'data-oldWidth', el.width() ); 229 } ); 230 231 jQuery(document).ready(function() { 232 all_videos.each( function() { 233 var el = jQuery(this), 234 newWidth = el.parents().width(), 235 oldWidth = el.attr( 'data-oldWidth' ); 236 ratioHeight = el.height() / el.outerHeight(), 237 238 el 239 .removeAttr( 'height' ) 240 .removeAttr( 'width' ) 241 .width( newWidth * ratioHeight ) 242 .outerHeight( newWidth * el.attr( 'data-aspectRatio' ) ); 243 }); 244 }).resize(); 245 246 jQuery(window) 247 .resize( function() { 248 all_videos.each( function() { 249 var el = jQuery(this), 250 newWidth = el.parents().width(), 251 oldWidth = el.attr( 'data-oldWidth' ); 252 ratioHeight = el.height() / el.outerHeight(), 253 254 el 255 .removeAttr( 'height' ) 256 .removeAttr( 'width' ) 257 .width( newWidth * ratioHeight ) 258 .outerHeight( newWidth * el.attr( 'data-aspectRatio' ) ); 259 }); 260 }).resize(); 261}); 262 263/* SoundCloud */ 264jQuery(document).ready(function() { 265
266 /* Supported Platforms */ 267 var all_sounds = jQuery( 'iframe[src^="http://w.soundcloud.com"]' ); 268 269 all_sounds.each(function() { 270 var el = jQuery(this); 271 el 272 .attr( 'data-aspectRatio', el.attr( 'height' ) / el.attr( 'width' ) ) 273 .attr( 'data-oldWidth', el.width() ); 274 }); 275 276 jQuery(document).ready(function() { 277 all_sounds.each( function() { 278 var el = jQuery(this), 279 newWidth = el.parents().width(), 280 oldWidth = el.attr( 'data-oldWidth' ); 281 282 el 283 .removeAttr( 'width' ) 284 .width( newWidth ) 285 }); 286 }).resize(); 287 288 jQuery(window) 289 .resize( function() { 290 all_sounds.each( function() { 291 var el = jQuery(this), 292 newWidth = el.parents().width(), 293 oldWidth = el.attr( 'data-oldWidth' ); 294 295 el 296 .removeAttr( 'width' ) 297 .width( newWidth ) 298 }); 299 }).resize(); 300}); 301 302 303/* ---------------------------------------------------------------------------------- 304 ADD PRETTYPHOTO TO PORTFOLIO PAGE 305---------------------------------------------------------------------------------- */ 306 307jQuery(document).ready(function() { 308 jQuery('#container.portfolio-wrapper a').has('img.hover-zoom').addClass('prettyPhoto'); 309 jQuery('#container.portfolio-wrapper a').has('img.hover-zoom').attr('rel','portfolio[gallery]'); 310 jQuery('a.prettyPhoto').has('img').attr('rel','portfolio[gallery]'); 311 jQuery('a.prettyPhoto').prettyPhoto(); 312}); 313 314 315 316/* ---------------------------------------------------------------------------------- 317 ADD PRETTYPHOTO TO POST IMAGE PAGE 318---------------------------------------------------------------------------------- */ 319 320jQuery(document).ready(function() { 321 jQuery('body.attachment .entry-attachment .attachment a').has('img').addClass('prettyPhoto'); 322 jQuery('a.prettyPhoto').prettyPhoto(); 323}); 324 325 326/* ---------------------------------------------------------------------------------- 327 MASONRY - LOAD AFTER IMAGES HAVE LOADED 328---------------------------------------------------------------------------------- */ 329 330jQuery(document).ready(function() { 331 332 // Call imagedLoaded for Masonry if imagedLoaded function is available 333 (function ( $ ) { 334 if ( $.isFunction($.fn.imagesLoaded) ) { 335 336 // Different target for masonry on portfolio pages than any other page 337 if ( $( '#container' ).hasClass( 'portfolio-wrapper' ) ) { 338 var $container = $('#container-inner'); 339 } else if ( $( 'body' ).hasClass( 'woo-shop-grid' ) ) { 340 var $container = $('#main-core .products'); 341 } else { 342 var $container = $('#container'); 343 } 344 345 $container.imagesLoaded( function() { 346 if ( $.isFunction($.fn.masonry) ) { 347 $container.masonry(); 348 } 349 }); 350 } 351 }( jQuery )); 352}); 353 354 355/* ---------------------------------------------------------------------------------- 356 WIDGETS 357---------------------------------------------------------------------------------- */ 358 359/* Categories */ 360jQuery(document).ready(function(){ 361 jQuery('.widget.thinkup_widget_categories .cat-item a').prepend('<i class="icon-caret-right icon-large"></i>'); 362}); 363 364 365/* ---------------------------------------------------------------------------------- 366 ADD _BLANK TO OUTGOING LINKS 367---------------------------------------------------------------------------------- */ 368 369jQuery(document).ready(function(){ 370 jQuery('.thinkup_widget_flickr a[href^="http://"], .thinkup_widget_flickr a[href^="https://"]').attr('target','_blank'); 371 jQuery('.thinkup_widget_socialshare a[href^="http://"], .thinkup_widget_socialshare a[href^="https://"]').attr('target','_blank'); 372 jQuery('.thinkup_widget_socialprofiles a[href^="http://"], .thinkup_widget_socialprofiles a[href^="https://"]').attr('target','_blank'); 373 jQuery('#pre-header-social a[href^="http://"], #pre-header-social a[href^="https://"]').attr('target','_blank'); 374 jQuery('#shareicons a[href^="http://"], #shareicons a[href^="https://"]').attr('target','_blank'); 375}); 376 377 378/* ---------------------------------------------------------------------------------- 379 SHORTCODES 380---------------------------------------------------------------------------------- */ 381 382jQuery(document).ready(function() { 383 384 /* Accordion - Fix Bootstrap Toggle Issue */ 385 jQuery('.accordion-toggle').click(function() { 386 if(jQuery(this).hasClass('collapsed')) { 387 jQuery(this).closest('.accordion').find('.accordion-toggle').not(this).addClass('collapsed'); 388 } 389 }); 390 391 /* Divider - Scroll To Top */ 392 jQuery('.backtotop').click(function(){ 393 jQuery('html, body').animate({scrollTop:0}, 'slow'); 394 }); 395 396 /* Lightbox - Add Image Overlay*/ 397 jQuery('.lightbox').after('<span class="lightbox-overlay"></span>'); 398 399 /* Tooltip - Activate Bootstrap */ 400 jQuery('[data-tip]').each( function() {jQuery(this).tooltip({ placement: jQuery(this).data('tip') }); }); 401 402 /* Blog Post - Carousel (used for identifying if input variable is an integer */ 403 function isNumber(n) { 404 return !isNaN(parseFloat(n)) && isFinite(n); 405 } 406 407 /* Blog Post - Activate CarouFredSel */ 408 jQuery(window).bind( 'load resize', function() { 409 jQuery( '.sc-carousel' ).each( function(i) { 410 411 // Don't run caroufredsel code if the following classes are present. 412 if ( jQuery( this ).hasClass( 'sc-postitem' ) || 413 jQuery( this ).hasClass( 'sc-featured' ) || 414 jQuery( this ).hasClass( 'sc-image' ) ) { 415 return; 416 }; 417
418 var instanceID = 'sc-carousel-' + i; 419 420 jQuery( this ).attr( 'id', instanceID ); 421 422 jQuery( this ).children( 'ul').attr( 'id', instanceID + '-inner' ); 423 424 var show = jQuery( '#' + instanceID + '.sc-carousel' ).data( 'show' ); 425 var scroll = jQuery( '#' + instanceID + '.sc-carousel' ).data( 'scroll' ); 426 var speed = jQuery( '#' + instanceID + '.sc-carousel' ).data( 'speed' ); 427 var effect = jQuery( '#' + instanceID + '.sc-carousel' ).data( 'effect' ); 428 429 if ( show == 0 || isNaN( show ) == true ) show = '3'; 430 if ( scroll == 0 || isNaN( scroll ) == true ) scroll = '1'; 431 if ( speed == 0 ) speed = '500'; 432 if ( effect == 0 ) { 433 effect = '"scroll"'; 434 } else { 435 effect = '"' + effect + '"'; 436 } 437 438 var showItems = show; 439 var scrollItems = scroll; 440 var speedItems = speed; 441 var fxItems = effect; 442 443 var width = jQuery(window).width(); 444 445 if ( jQuery( 'body' ).hasClass( 'layout-responsive' ) ) { 446 if(width <=685) { 447 showItems = 2; 448 if( scrollItems >= 2 ) { 449 scrollItems = 2; 450 } 451 } 452 if(width <=480) { 453 showItems = 1; 454 scrollItems = 1; 455 } 456 } 457 458 // Apply carousel code if needed 459 if ( jQuery( this ).find( '#' + instanceID + '-inner' ).length ) { 460 461 jQuery( this ).find( '#' + instanceID + '-inner' ).carouFredSel({ 462 width: '100%', 463 items : { 464 visible : showItems, 465 minimum : 3, 466 minimum : 3, 467 start: 0 468 }, 469 scroll : { 470 items : scrollItems, 471 fx : fxItems, 472 easing : "swing", 473 duration : speedItems, 474 }, 475 responsive : true, 476 circular : true, 477 infinite : false, 478 auto : false, 479 prev : { 480 button : '#' + instanceID + ' .prev', 481 key : 'left' 482 }, 483 next : { 484 button : '#' + instanceID + ' .next', 485 key : 'right' 486 }, 487 pagination : '#' + instanceID + ' .pagination', 488 onCreate: function () { 489 jQuery(window).bind("load resize", function() { 490 491 // Set height to testimonial carousel elements - All 492 parentWidthTestimonial = jQuery( '#' + instanceID + '.carousel-testimonial li').outerHeight(); 493 jQuery( '#' + instanceID + '.carousel-testimonial' ).height( 'auto' ); 494 jQuery( '#' + instanceID + '.carousel-testimonial .caroufredsel_wrapper' ).css( { 'height': parentWidthTestimonial } ); 495 496 // Set height to testimonial carousel elements - Fix Style 1 497 parentWidthTestimonial_1 = jQuery( '#' + instanceID + '.carousel-testimonial.style1 .caroufredsel_wrapper').outerHeight(); 498 parentWidthTestimonial_2 = jQuery( '#' + instanceID + '.carousel-testimonial.style1 .sc-carousel-thumbs').outerHeight(); 499 500 jQuery( '#' + instanceID + '.carousel-testimonial.style1' ).height( parentWidthTestimonial_1 + parentWidthTestimonial_2 ); 501 jQuery( '#' + instanceID + '.carousel-testimonial.style1 .sc-carousel-thumbs' ).parent().height( parentWidthTestimonial_2 ); 502 }); 503 } 504 }); 505 } 506 507 // Used for adding thumbnails to slider - Currently only for Testimonials slider 508 if ( jQuery( this ).find('.sc-carousel-thumbs').length ) { 509 510 jQuery( this ).find('.sc-carousel-thumbs').carouFredSel({ 511 responsive: true, 512 circular: false, 513 infinite: false, 514 auto: false, 515 prev: '#prev', 516 next: '#next', 517 items: { 518 visible: { 519 min: 2, 520 max: 6 521 }, 522 width: 150, 523 height: 70 524 } 525 }); 526 } 527 528 jQuery( this ).find('.sc-carousel-thumbs a').click(function() { 529 jQuery('#' + instanceID + '-inner').trigger('slideTo', '#' + this.href.split('#').pop() ); 530 jQuery('.sc-carousel-thumbs a').removeClass('selected'); 531 jQuery( this ).addClass('selected'); 532 return false; 533 }); 534 535 // Set carousel container height 536 parentHeight = jQuery( '#' + instanceID + ' li').height(); 537 jQuery( '#' + instanceID + ' li' ).each(function() { 538 var elementHeight = jQuery(this).height(); 539 parentHeight = elementHeight > parentHeight ? elementHeight : parentHeight; 540 }); 541 542 // Add addition height if carousel thumbnails are showing 543 if( jQuery( '#' + instanceID ).closest('.sc-carousel').find('.sc-carousel-thumbs').length > 0 ) { 544 parentHeightThumb = parentHeight + jQuery( '#' + instanceID ).closest('.sc-carousel').find('.sc-carousel-thumbs').height(); 545 } else { 546 parentHeightThumb = parentHeight; 547 } 548 549 // Assign height to unique carousel ID (Max used to ensure thumbnail carousel displays correctly) 550 jQuery( '#' + instanceID ).height( Math.max( parentHeight, parentHeightThumb ) ); 551 jQuery( '#' + instanceID + '-inner' ).height( parentHeight ); 552 jQuery( '#' + instanceID + '-inner' ).parent().height( parentHeight ); 553 554 // Set carousel container height to auto if iframe exists in featured images 555 if ( jQuery( '#' + instanceID + ' iframe').length > 0 ) { 556 jQuery( '#' + instanceID ).addClass('carousel-iframe'); 557 } 558 }); 559 560 }).resize(); 561 562 /* Progress Bar - Animate Width */ 563 jQuery('.progress').waypoint( 564 function(event, direction) { 565 566 var width = jQuery(this).children().attr('data-width');
567 var delay = jQuery(this).children().attr('data-delay'); 568 569 jQuery(this).delay( delay ).queue(function(next){ 570 jQuery(this).children().width( ( width - 20 ) + '%' ); 571 }); 572 }, { 573 offset: 'bottom-in-view' 574 }); 575 576 /* Progress Knob - Triggers and adds a delay is set by user */ 577 jQuery(document).ready(function() { 578 579 // Trigger knob so that input box doesn't show (with percentage) - Progress (Round) 580 jQuery( '.sc-knob:not(.sc-counter) .sc-knob-dial' ).knob({ 581 'draw' : function () { 582 jQuery(this.i).val(this.cv + '%'); 583 } 584 }) 585 586 // Trigger knob so that input box doesn't show (without percentage) - Counter 587 jQuery( '.sc-knob.sc-counter .sc-knob-dial' ).knob({ 588 'draw' : function () { 589 590 // Add suffix set 591 var suffix = jQuery(this.i).attr( 'data-suffix' ); 592 593 // Remove value is set to zero 594 if( this.cv == '0') { 595 this.cv = '' 596 }; 597 598 jQuery(this.i).val(this.cv + suffix); 599 } 600 }) 601 602 // Trigger waypoint for all knobs 603 jQuery( '.sc-knob' ).waypoint( 604 function(event, direction) { 605 jQuery('.sc-knob .sc-knob-dial').each( function(i) { 606 607 var instanceID = 'sc-knob-' + i; 608 609 jQuery( this ).attr( 'id', instanceID ); 610 611 var input_time = jQuery( '#sc-knob-' + i ).attr('data-delay'); 612 var input_value = jQuery( '#sc-knob-' + i ).attr('data-value'); 613 614 setTimeout(function() { 615 jQuery({ 616 value: 0 617 }).animate({ 618 value: input_value 619 }, { 620 duration: 2000, 621 easing: 'swing', 622 step: function() { 623 return jQuery('#sc-knob-' + i).val(Math.ceil(this.value)).trigger('change'); 624 } 625 }); 626 }, input_time ); 627 }); 628 }, { 629 offset: 'bottom-in-view', 630 triggerOnce: true 631 }); 632 }); 633 634 /* Make slider full width if specified */ 635 jQuery( '.rslides-sc' ).each(function( index, element ){ 636 637 jQuery( element ).attr( 'id', 'thinkupbuilder-sliderimage-' + index ); 638 639 // Collect slider parameter values 640 var wide = jQuery( element ).data( 'wide' ); 641 642 // Format row section for full-screen slider 643 if ( wide == 'on' ) { 644 jQuery( element ).closest( '.panel-grid' ).css( 'padding', 0 ); 645 jQuery( element ).closest( '.panel-grid-core' ).css( 'margin', 0 ).css( 'maxWidth', '100%' ); 646 jQuery( element ).closest( '.panel-grid-cell' ).css( 'padding', 0 ); 647 } 648 }); 649 650 /* Make ThinkUpSlider shortcode full width if specified */ 651 jQuery( '.thinkupslider-sc' ).each(function( index, element ){ 652 653 jQuery( element ).attr( 'id', 'thinkupbuilder-thinkupsliderimage-' + index ); 654 655 // Collect slider parameter values 656 var wide = jQuery( element ).data( 'wide' ); 657 658 // Format row section for full-screen slider 659 if ( wide == 'on' ) { 660 jQuery( element ).closest( '.panel-grid' ).css( 'padding', 0 ); 661 jQuery( element ).closest( '.panel-grid-core' ).css( 'margin', 0 ).css( 'maxWidth', '100%' ); 662 jQuery( element ).closest( '.panel-grid-cell' ).css( 'padding', 0 ); 663 } 664 }); 665}); 666 667 668/* ---------------------------------------------------------------------------------- 669 SHORTCODES - WAYPOINTS ANIMATION 670---------------------------------------------------------------------------------- */ 671 672jQuery(document).ready(function() { 673 674 jQuery('.anim-start-ltr').waypoint( 675 function(event, direction) { 676 var time = jQuery(this).parent().attr('title'); 677 678 jQuery(this).delay( time ).queue(function(next){ 679 jQuery(this).removeClass( 'anim-start-ltr' ).addClass( 'anim-end-ltr' ); 680 jQuery(this).parent().removeAttr( 'title' ); 681 }); 682 }, { 683 offset: 'bottom-in-view' 684 }); 685 686 jQuery('.anim-start-rtl').waypoint( 687 function(event, direction) { 688 var time = jQuery(this).parent().attr('title'); 689 690 jQuery(this).delay( time ).queue(function(next){ 691 jQuery(this).removeClass( 'anim-start-rtl' ).addClass( 'anim-end-rtl' ); 692 jQuery(this).parent().removeAttr( 'title' ); 693 }); 694 }, { 695 offset: 'bottom-in-view' 696 }); 697 698 jQuery('.anim-start-btt').waypoint( 699 function(event, direction) { 700 var time = jQuery(this).parent().attr('title'); 701 702 jQuery(this).delay( time ).queue(function(next){ 703 jQuery(this).removeClass( 'anim-start-btt' ).addClass( 'anim-end-btt' ); 704 jQuery(this).parent().removeAttr( 'title' ); 705 }); 706 }, { 707 offset: 'bottom-in-view' 708 }); 709 710 jQuery('.anim-start-ttb').waypoint( 711 function(event, direction) { 712 var time = jQuery(this).parent().attr('title'); 713 714 jQuery(this).delay( time ).queue(function(next){ 715 jQuery(this).removeClass( 'anim-start-ttb' ).addClass( 'anim-end-ttb' ); 716 jQuery(this).parent().removeAttr( 'title' ); 717 }); 718 }, { 719 offset: 'bottom-in-view' 720 }); 721 722 jQuery('.anim-start-stb').waypoint( 723 function(event, direction) { 724 var time = jQuery(this).parent().attr('title'); 725 726 jQuery(this).delay( time ).queue(function(next){ 727 jQuery(this).removeClass( 'anim-start-stb' ).addClass( 'anim-end-stb '+ time ); 728 jQuery(this).parent().removeAttr( 'title' ); 729 }); 730 }, { 731 offset: 'bottom-in-view' 732 }); 733 734});
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.