1/** 2 * Go Pricing - WordPress Responsive Pricing Tables 3 * 4 * Description: The New Generation Pricing Tables. If you like traditional Pricing Tables, but you would like get much more out of it, then this rodded product is a useful tool for you. 5 * Version: 3.3.16 6 * Author: Granth 7 * License: https://codecanyon.net/licenses/ 8 * 9 * (C) 2019 Granth (https://granthweb.com) 10 */ 11 12var gwGS = gwGS || {}; 13;(function ($, TimelineLite, TweenLite, undefined ) { 14 "use strict"; 15 16 /** 17 * Initialize 18 */ 19 20 $.GoPricing = { 21 22 /* Init function */ 23 Init : function () { 24 this.$wrap = $('.gw-go'); 25 this.fixWidth(); 26 this.equalize = this.$wrap.data('equalize'); 27 this.InitMediaElementPlayer(); 28 this.InitGoogleMap(); 29 this.isIE = document.documentMode != undefined && document.documentMode >5 ? document.documentMode : false; 30 if (this.isIE) { 31 this.$wrap.addClass('gw-go-ie'); 32 if (this.isIE < 9) this.$wrap.addClass('gw-go-oldie'); 33 }; 34 if ($.GoPricing!=undefined && $.GoPricing.equalize) { 35 this.EqualizeRows(); 36 }; 37 this.InitAnim(); 38 this.eventType = this.detectEvent(); 39 this.timeout = []; 40 41 }, 42 43 InitAnim: function() { 44 this.$wrap.each(function( i, obj ) { 45 46 $(obj).css('opacity', 1); 47 if ( !TimelineLite || !TweenLite) return; 48 49 var $cols = $(".gw-go-col-wrap[data-col-anim]", this); 50 if ($cols.length) { 51 var tl = new TimelineLite({ 52 paused: true, 53 onStart: function() { 54 var tw = this.getChildren(), i = tw.length; 55 while (i--) if (tw[i].vars.onUpdate) tw[i].vars.onUpdate(); 56 } 57 }); 58 $cols.each(function(i, col) { 59 var anim = $(col).data('col-anim') || {}; 60 if (anim.trans) { 61 anim.css.opacity /= 100, anim.css.scaleX /= 100, anim.css.scaleY /= 100; 62 tl.add( TweenLite.from(col, anim.trans.duration/1000, {css: anim.css, ease: anim.trans.ease}), anim.trans.delay/1000 ); 63 } 64 if (anim.count) { 65 var $price = $('[data-id=price]', col), 66 counter = { value : (anim.count.from || 0) }, 67 $amount = $price.find('[data-id=amount]'), 68 price = $price.data('price') || 0, 69 currency = $price.data('currency') || {}, 70 decimals = (price || '').toString().split('.')[1] || '', 71 decCnt = decimals.length; 72 73 if ($price.data('trailing-zero')) decCnt = $price.data('decimal-no'); 74 75 tl.add( TweenLite.to(counter, anim.count.duration/1000, { 76 value: price, 77 ease: anim.count.ease, 78 onUpdate: function() { 79 var c = counter.value 80 $amount.html(function() { 81 var parts = parseFloat(c).toFixed(decCnt).split('.'); 82 parts[0] = parts[0].replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1"+(currency['thousand-sep'] || ' ')); 83 parts[1] = parts[1] ? ( ( currency['decimal-sep'] || '.' ) + parts[1] ) : ''; 84 return parts[0] + parts[1]; 85 }); 86 87 }, 88 }), anim.count.delay/1000 ); 89 } 90 }); 91 var $this = $(this).data('tl', tl); 92 $this.tablespy({offset: $this.data('scroll-offset')}); 93 TweenLite.set(this, {perspective: '1000px'}); 94 } 95 }); 96 }, 97 98 /* Show Tooltip */ 99 showTooltip : function ($elem, content, top) { 100 101 if ($elem === undefined) return; 102 103 var $rowTooltip = $elem.find('.gw-go-tooltip-content'), 104 rowTooltipContent = $rowTooltip.length ? $rowTooltip.prop('outerHTML') : '', 105 $colWrap = $elem.closest('.gw-go-col-wrap'), 106 $col = $colWrap.find('.gw-go-col'), 107 $tooltip = $col.find('.gw-go-tooltip'), 108 colIndex = $colWrap.data('col-index'), 109 rIndex = $elem.data('row-index'); 110 111 if (!$tooltip.length ) $tooltip = $('<div class="gw-go-tooltip"></div>').appendTo($col); 112 113 if ($tooltip.data('index') != rIndex) { 114 $tooltip.removeClass('gw-go-tooltip-visible'); 115 } else { 116 clearTimeout($.GoPricing.timeout[colIndex]); 117 } 118 119 if (rowTooltipContent != '') { 120 $tooltip.html(rowTooltipContent).data('index', rIndex) 121 var corr = $col.position().top; 122 setTimeout(function() { $tooltip.addClass('gw-go-tooltip-visible').css('top', $elem.find('.gw-go-body-cell').offset().top - $col.closest('.gw-go-col-wrap').offset().top - $tooltip.outerHeight() - 16 - corr) }, 10); 123 } 124 125 }, 126 127 /* Hide Tooltip */ 128 hideTooltip : function ($elem) { 129 130 if ($elem === undefined) return; 131 132 if ($elem.hasClass('gw-go-tooltip')) { 133 $elem.removeClass('gw-go-tooltip-visible'); 134 } else { 135 136 var $colWrap = $elem.closest('.gw-go-col-wrap'), 137 $col = $colWrap.find('.gw-go-col'), 138 $tooltip = $col.find('.gw-go-tooltip'), 139 colIndex = $colWrap.data('col-index'); 140 141 $.GoPricing.timeout[colIndex] = setTimeout(function() { $tooltip.removeClass('gw-go-tooltip-visible'); }, 10); 142 143 } 144 145 }, 146 147 /* Mediaelement Player init */ 148 InitMediaElementPlayer : function () { 149 150 if (jQuery().mediaelementplayer && $.GoPricing.$wrap.find('audio, video').length) { 151 $.GoPricing.$wrap.find('audio, video').mediaelementplayer({ 152 audioWidth: '100%', 153 videoWidth: '100%' 154 }); 155 }; 156 157 }, 158 159 /* Google map init */ 160 InitGoogleMap : function () { 161 162 if (jQuery().goMap && $.GoPricing.$wrap.find('.gw-go-gmap').length) { 163 $.GoPricing.$wrap.find('.gw-go-gmap').each(function(index) { 164 var $this=$(this); 165 $this.goMap($this.data('map')); 166 });
167 }; 168 169 }, 170 171 loadImages : function ( $pricingTable ) { 172 173 if ( !$pricingTable.data('images') || $pricingTable.data('imagesLoaded')) return; 174 175 var images = $pricingTable.data('images'), 176 loadedCount = $pricingTable.data('imagesLoadedCnt') ? parseInt($pricingTable.data('imagesLoadedCnt')) : 0; 177 178 for (var x = 0; x < images.length; x++) { 179 var image = images[x]; 180 if ($(image.el).data('loading')) continue; 181 $(image.el).data('loading', true); 182 var img = new Image(); 183 img.onerror = function(){ 184 $pricingTable.data('imagesLoadedCnt', ++loadedCount); 185 }; 186 img.onload = function(e){ 187 $pricingTable.data('imagesLoadedCnt', ++loadedCount); 188 }; 189 img.src = image.el.src; 190 } 191 192 if (loadedCount == images.length) { 193 $pricingTable.data('imagesLoaded', true); 194 this.EqualizeRows(); 195 return; 196 } 197 198 setTimeout($.proxy(function() { 199 this.loadImages($pricingTable); 200 }, this), 100); 201 202 }, 203 204 /* Fix width in webkit browsers */ 205 fixWidth : function() { 206 207 if ( 'WebkitAppearance' in document.documentElement.style === false || window.StyleMedia ) return; 208 209 for (var x = 0; x < $.GoPricing.$wrap.length; x++) { 210 211 var $pricingTable = $.GoPricing.$wrap.eq(x), 212 $cols = $pricingTable.find('.gw-go-col-wrap'); 213 214 if ($pricingTable.is(':hidden') || $pricingTable.offset().top>parseInt($(document).scrollTop()+window.innerHeight+500) || $pricingTable.data('fix-width') === true || $cols.length < 2 ) continue; 215 216 for (var i = 0; i < $cols.length; i++) { 217 218 var $col = $cols.eq(i), 219 fixedMaxWidth = parseInt($pricingTable.data('mw')), 220 maxWidth = Math.floor(parseFloat(window.getComputedStyle($col[0]).width)); 221 222 if ( !fixedMaxWidth || maxWidth < fixedMaxWidth ) { 223 $cols.css('max-width', 'none'); 224 $cols.css('max-width', Math.floor(parseFloat(window.getComputedStyle($col[0]).width))); 225 } 226 227 } 228 229 $pricingTable.data('fix-width', true); 230 231 } 232 233 }, 234 235 /* Equalize rows */ 236 EqualizeRows : function () { 237 238 for (var x = 0; x < $.GoPricing.$wrap.length; x++) { 239 240 if ($.GoPricing.$wrap.eq(x).is(':hidden') || $.GoPricing.$wrap.eq(x).offset().top>parseInt($(document).scrollTop()+window.innerHeight+500) || $.GoPricing.$wrap.eq(x).data('eq-ready') === true ) continue; 241 242 var $pricingTable = $.GoPricing.$wrap.eq(x), 243 $colWrap = $pricingTable.find('.gw-go-col-wrap:visible'), 244 colCnt = $colWrap.length, 245 equalizeCnt = colCnt, 246 views = $pricingTable.data('views') !== undefined ? $pricingTable.data('views') : {}; 247 248 /* Load images */ 249 if ( !$pricingTable.data('images') && !$pricingTable.data('imagesLoaded') ) { 250 var images = []; 251 if ($pricingTable.data('equalize').body != undefined) { $pricingTable.find('.gw-go-body li .gw-go-body-cell:visible img').each(function(index, el){ images.push({'ready' : false, 'el' : el }) }); } 252 if ($pricingTable.data('equalize').footer != undefined) { $pricingTable.find('.gw-go-footer .gw-go-footer-row-inner:visible img').each(function(index, el){ images.push({'ready' : false, 'el' : el }) }); } 253 if ($pricingTable.data('equalize').column != undefined) { $pricingTable.find('.gw-go-header img').each(function(index, el){ images.push({'ready' : false, 'el' : el }) }); } 254 255 if ( images.length ) $pricingTable.data( 'images', images ); 256 257 } 258 259 if ( $pricingTable.data('images') && !$pricingTable.data('imagesLoaded') ) { 260 this.loadImages( $pricingTable ); 261 continue; 262 } 263 264 for (var key in views) { 265 266 var mqSizes = [], mq = ''; 267 if (views[key].min !== undefined && views[key].min !== '') mqSizes.push('(min-width:'+views[key].min+'px)'); 268 if (views[key].max !== undefined && views[key].max !== '') mqSizes.push('(max-width:'+views[key].max+'px)'); 269 mq = mqSizes.join(' and '); 270 271 if (mq != '') if (window.matchMedia && window.matchMedia(mq).matches) { 272 equalizeCnt = views[key].cols !== undefined && views[key].cols !== '' && views[key].cols <= colCnt ? views[key].cols : colCnt; 273 } 274 275 } 276 277 if (equalizeCnt == 1) { 278 $pricingTable.find('.gw-go-body li .gw-go-body-cell').css('height', 'auto'); 279 $pricingTable.find('.gw-go-col-wrap').css('height', 'auto'); 280 $pricingTable.find('.gw-go-footer').css('height', 'auto'); 281 continue; 282 } 283 284 for (var z = 0; z<colCnt/equalizeCnt; z++) { 285 286 if (!$pricingTable.is(':hidden')) $pricingTable.data('eq-ready', true); 287 288 var rowHeights = [], footerHeights = [], colHeights = []; 289 290 /* Body */ 291 if ($pricingTable.data('equalize').body != undefined) { 292 293 for (var i = 0; i < colCnt; i++) { 294 if (i >= (z*equalizeCnt) && i <= (z*equalizeCnt)+equalizeCnt-1) { 295 var $currentCol = $colWrap.eq(i), 296 $row = $currentCol.find('.gw-go-body li .gw-go-body-cell:visible'); 297 298 for (var rIndex = 0; rIndex < $row.length; rIndex++) { 299 300 var $currentRow = $row.eq(rIndex); 301 $currentRow.css('height', 'auto'); 302 303 if (typeof rowHeights[rIndex] !== 'undefined' ) { 304 if ($currentRow.height() > rowHeights[rIndex] ) { 305 rowHeights[rIndex] = $currentRow.height(); 306 } 307 } else { 308 rowHeights[rIndex] = $currentRow.height(); 309 } 310 311 } 312 313 } 314 315 } 316 317 for (var i = 0; i < colCnt; i++) { 318 var $currentCol = $colWrap.eq(i), 319 $row = $currentCol.find('.gw-go-body li .gw-go-body-cell:visible'); 320 321 if (i >= (z*equalizeCnt) && i <= (z*equalizeCnt)+equalizeCnt-1) { 322 for (var rIndex = 0; rIndex < $row.length; rIndex++) { 323 var $currentRow = $row.eq(rIndex); 324 $currentRow.css('height', rowHeights[rIndex]); 325 } 326 327 } 328 329 330 331 } 332 333 } 334 335 /* Footer */ 336 if ($pricingTable.data('equalize').footer != undefined) { 337 338 for (var i = 0; i < colCnt; i++) { 339 if (i >= (z*equalizeCnt) && i <= (z*equalizeCnt)+equalizeCnt-1) { 340 var $currentCol = $colWrap.eq(i), 341 $row = $currentCol.find('.gw-go-footer .gw-go-footer-row-inner:visible'); 342 343 for (var rIndex = 0; rIndex < $row.length; rIndex++) { 344 345 var $currentRow = $row.eq(rIndex); 346 $currentRow.css('height', 'auto'); 347 348 if (typeof footerHeights[rIndex] !== 'undefined' ) { 349 if ($currentRow.height() > footerHeights[rIndex] ) { 350 footerHeights[rIndex] = $currentRow.height(); 351 } 352 } else { 353 footerHeights[rIndex] = $currentRow.height(); 354 } 355 356 } 357 358 } 359 360 } 361 362 for (var i = 0; i < colCnt; i++) { 363 var $currentCol = $colWrap.eq(i), 364 $row = $currentCol.find('.gw-go-footer .gw-go-footer-row-inner:visible'); 365 366 if (i >= (z*equalizeCnt) && i <= (z*equalizeCnt)+equalizeCnt-1) { 367 for (var rIndex = 0; rIndex < $row.length; rIndex++) { 368 var $currentRow = $row.eq(rIndex); 369 $currentRow.css('height', footerHeights[rIndex]); 370 } 371 372 } 373 374 375 376 } 377 378 } 379 380 /* Column */ 381 if ($pricingTable.data('equalize').column != undefined) { 382 383 for (var i = 0; i < colCnt; i++) { 384 var $currentCol = $colWrap.eq(i); 385 386 if (i >= (z*equalizeCnt) && i <= (z*equalizeCnt)+equalizeCnt-1) { 387 $currentCol.css('height', 'auto'); 388 if (typeof colHeights[z] !== 'undefined' ) { 389 if ($currentCol.outerHeight(true) > colHeights[z] ) { 390 colHeights[z] = $currentCol.outerHeight(false); 391 } 392 } else { 393 colHeights[z] = $currentCol.outerHeight(false); 394 } 395 } 396 397 } 398 399 for (var i = 0; i < colCnt; i++) { 400 var $currentCol = $colWrap.eq(i); 401 402 if (i >= (z*equalizeCnt) && i <= (z*equalizeCnt)+equalizeCnt-1) { 403 $currentCol.css('height', colHeights[z]); 404 } 405 406 } 407 408 } 409 410 411 } 412 413 } 414 415 }, 416 417 /* Detect event type */ 418 detectEvent : function() { 419 var eventType = 'mouseenter mouseleave'; 420 if ('ontouchstart' in window) { 421 eventType = 'touchstart'; 422 } else if (window.navigator.pointerEnabled && navigator.msMaxTouchPoints) { 423 eventType = "pointerdown"; 424 } else if (window.navigator.msPointerEnabled && navigator.msMaxTouchPoints) { 425 eventType = "MSPointerDown"; 426 } 427 return eventType; 428 } 429 430 }; 431 432 $(function() { 433 434 /* Init */ 435 $.GoPricing.Init(); 436 437 $(window).on('scroll', function() { 438 439 $.GoPricing.fixWidth(); 440 $.GoPricing.EqualizeRows(); 441 442 }); 443 444 /* Submit button event if form found */ 445 $.GoPricing.$wrap.delegate('span.gw-go-btn', 'click', function(){ 446 var $this=$(this); 447 if ($this.find('form').length) { $this.find('form').submit(); }; 448 }); 449 450 451 /* Show & hide tooltip - Event on tooltip */ 452 $.GoPricing.$wrap.on( 'mouseenter mouseleave', '.gw-go-tooltip', function(e) { 453 454 var $this=$(this), 455 $colWrap = $this.closest('.gw-go-col-wrap'), 456 colIndex = $colWrap.data('col-index'); 457 458 if (e.type == 'mouseenter') { 459 clearTimeout($.GoPricing.timeout[colIndex]); 460 } else { 461 $.GoPricing.timeout[colIndex] = setTimeout(function() { $.GoPricing.hideTooltip($this); }, 10); 462 } 463 464 }); 465 466 467 /* Show & hide tooltip - Event on row */ 468 $.GoPricing.$wrap.on( 'mouseenter mouseleave', 'ul.gw-go-body > li', function(e) { 469 470 var $this=$(this); 471 472 if (e.type == 'mouseenter') { 473 $.GoPricing.showTooltip($this); 474 } else { 475 $.GoPricing.hideTooltip($this); 476 } 477 478 }); 479 480 481 /* Column hover / touch - supports mouse, touch and pointers */ 482 483 // Pointer enter event 484 function enterEvent( $elem ) { 485 $elem.addClass('gw-go-curr'); 486 $elem.siblings().data('leave-event', null).data('enter-event', null); 487 $elem.data('leave-event', null); 488 if ($elem.hasClass('gw-go-disable-hover')) { 489 $elem.siblings(':not(.gw-go-disable-hover)').removeClass('gw-go-hover'); 490 } else { 491 $elem.addClass('gw-go-hover').siblings(':not(.gw-go-disable-hover)').removeClass('gw-go-hover'); 492 $elem.closest('.gw-go').addClass('gw-go-hover'); 493 } 494 }; 495 496 // Pointer leave event 497 function leaveEvent( $elem ) { 498 $elem.siblings().data('leave-event', null).data('enter-event', null); 499 $elem.data('enter-event', null); 500 $elem.removeClass('gw-go-curr'); 501 if ($elem.hasClass('gw-go-disable-hover')) { 502 $elem.closest('.gw-go').find('[data-current="1"]:not(.gw-go-disable-hover)').addClass('gw-go-hover'); 503 } else { 504 $elem.removeClass('gw-go-hover'); 505 $elem.closest('.gw-go').find('[data-current="1"]:not(.gw-go-disable-hover)').addClass('gw-go-hover'); 506 $elem.closest('.gw-go').removeClass('gw-go-hover'); 507 } 508 }; 509 510 // Enter event handling 511 $(document).on('pointerenter mouseenter pointerdown touchstart', '.gw-go-col-wrap', function(e) { 512 e.stopPropagation(); 513 var $this = $(this); 514 $this.closest('.gw-go').find('.gw-go-col-wrap').removeClass('gw-go-curr'); 515 if ($this.hasClass('gw-go-disable-hover')) { 516 $this.addClass('gw-go-curr'); 517 return; 518 } 519 $this.data('leave-event', null); 520 521 if ($this.data('enter-event')) return; 522 var event = { 523 pointer : e.originalEvent.pointerType == 'touch' || e.type == 'touchstart' ? 'touch' : 'mouse', 524 pageX : e.originalEvent.changedTouches ? e.originalEvent.changedTouches[0].pageX : e.originalEvent.pageX, 525 pageY : e.originalEvent.changedTouches ? e.originalEvent.changedTouches[0].pageY : e.originalEvent.pageY, 526 }; 527 if (event.pointer == 'mouse') { 528 enterEvent($this); 529 }; 530 $this.data('enter-event', event); 531 }); 532 533 // Leave event handling 534 $(document).on('pointerleave mouseleave pointerup touchend', '.gw-go-col-wrap', function(e) { 535 e.stopPropagation(); 536 var $this = $(this); 537 538 if ($this.hasClass('gw-go-disable-hover')) return; 539 540 if (!$this.data('enter-event') || $this.data('leave-event')) return; 541 var event = { 542 pointer : e.originalEvent.pointerType == 'touch' || e.type == 'touchend' ? 'touch' : 'mouse', 543 pageX : e.originalEvent.changedTouches ? e.originalEvent.changedTouches[0].pageX : e.originalEvent.pageX, 544 pageY : e.originalEvent.changedTouches ? e.originalEvent.changedTouches[0].pageY : e.originalEvent.pageY, 545 }; 546 if (event.pointer == 'mouse') { 547 $this.data('leave-event', event); 548 leaveEvent($this); 549 } else { 550 if (!$this.data('leave-event')) { 551 if (Math.abs($this.data('enter-event').pageX-event.pageX) > 20 || Math.abs($this.data('enter-event').pageY-event.pageY) > 20) { 552 $this.data('enter-event', null); 553 return; 554 } 555 enterEvent($this); 556 $this.data('leave-event', event); 557 $(document).on('touchstart.goprEvent pointermove.goprEvent mousemove.goprEvent', function(e) { 558 if ( $(e.target).closest('.go-pricing').length ) return; 559 leaveEvent($this); 560 $this.data('leave-event', null); 561 $this.data('enter-event', null); 562 $(document).off('.goprEvent'); 563 }); 564 } 565 } 566 567 }); 568 569 /** 570 * Google map 571 */ 572 if (typeof jQuery.goMap !== 'undefined' && $.GoPricing.$wrap.find('.gw-go-gmap').length) { 573 var GoPricing_MapResize=false; 574 $(window).on('resize', function(e) { 575 if (GoPricing_MapResize) { clearTimeout(GoPricing_MapResize); } 576 GoPricing_MapResize = setTimeout(function() { 577 $.GoPricing.$wrap.find('.gw-go-gmap').each(function(index, element) { 578 //$(this).goMap(); 579 //console.log($.goMap.getMarkers('markers')[0].position); 580 });
581 }, 400); 582 }); 583 }; 584 585 586 /* Equalize heights on resize */ 587 $(window).on('resize load', function(e) { 588 589 for (var x = 0; x < $.GoPricing.$wrap.length; x++) { 590 $.GoPricing.$wrap.eq(x).data('eq-ready', false); 591 $.GoPricing.$wrap.eq(x).data('fix-width', false); 592 } 593 $.GoPricing.fixWidth(); 594 $.GoPricing.EqualizeRows(); 595 596 }); 597 598 /* handle animations */ 599 $(window).on("scrollEnter scrollLeave", function(e, spy) { 600 var $target = $(e.target); 601 602 if ($target.data('anim') == 'off' || typeof spy === 'undefined') return; 603 var repeat = $target.data("anim-repeat") || Infinity; 604 if (e.type == "scrollEnter") { 605 if (spy.enters <= repeat) $target.data("tl").play(); 606 } else { 607 if (spy.enters < repeat) $target.data("tl").stop().seek(0); 608 } 609 }); 610 611 }); 612 613 614})(jQuery, gwGS.TimelineLite, gwGS.TweenLite ); 615 616;(function($, window, undefined) { 617 618 var $elems = $(); 619 var $cont = $(window) 620 .on("resize.tablespy", onResize) 621 .on("load.tablespy", onResize) 622 .on("scroll.tablespy load.tablespy", onScroll); 623 624 if ( window.frameElement ) { 625 window.parent.onload = function() { onScroll(); } 626 } 627 628 629 function onScroll() { 630 if (!$elems.length) return; 631 var height = $cont.height(); 632 var y = $cont.scrollTop(); 633 $elems.each(function() { 634 var $elem = $(this); 635 var o = $elem.data('tablespy'); 636 if (typeof o === "undefined") return; 637 var offset = o.rowHeight * o.offset / 100; 638 639 if (Math.floor((o.rowHeight+height)/2) < offset) offset = Math.floor((o.rowHeight+height)/2)-20; 640 641 if (height + y-offset >= o.min && y+offset <= o.max){ 642 if (!o.inside) { 643 o.inside = true; 644 o.enters++; 645 $elem.trigger("scrollEnter", {scrollTop: y, enters: o.enters, leaves: o.leaves}); 646 } 647 $elem.trigger("scrollTick", {scrollTop: y, enters: o.enters, leaves: o.leaves}); 648 } 649 if (o.inside && !(height + y >= o.min && y <= o.max)) { 650 o.inside = false; 651 o.leaves++; 652 $elem.trigger("scrollLeave", {scrollTop: y, enters: o.enters, leaves: o.leaves}); 653 } 654 }); 655 } 656 657 function onResize() { 658 $elems.each(function() { 659 var $elem = $(this); 660 var o = $elem.data("tablespy"); 661 if (typeof o === "undefined") return; 662 o.min = $elem.offset().top; 663 o.max = $elem.outerHeight() + o.min; 664 o.rowHeight = $elem.children(":visible:first").outerHeight(); 665 }); 666 } 667 668 $.fn.tablespy = function(options) { 669 var defaults = { 670 offset: 0, 671 enters: 0, 672 leaves: 0, 673 inside: false 674 }; 675 return this.each(function() { 676 var $elem = $(this); 677 var top = $elem.offset().top; 678 $elem.data("tablespy", $.extend({ 679 min: top, 680 max: top + $elem.outerHeight(), 681 rowHeight: $elem.children(":visible:first").outerHeight() 682 }, defaults, options)); 683 $elems.push(this); 684 }); 685 }; 686 687 /* Disable animation */ 688 $.GoPricing.disableAnim = function() { 689 this.$wrap.each(function (index, element) { 690 $(element).addClass('test'); 691 $(element).data('anim', 'off'); 692 $(element).css('opacity', 1); 693 if ( typeof $(element).data("tl") === 'undefined' ) { 694 return; 695 } 696 if ( $(element).data("tl").progress() == 1 ) return; 697 $(element).data("tl").progress(1); 698 }); 699 }; 700 701})(jQuery, window);
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.