vendor: 2,585 bytes, lines 1-74
1/*! 2 * jQuery Scrollify 3 * Version 1.0.20 4 * 5 * Requires: 6 * - jQuery 1.7 or higher 7 * 8 * https://github.com/lukehaas/Scrollify 9 * 10 * Copyright 2016, Luke Haas 11 * Permission is hereby granted, free of charge, to any person obtaining a copy of 12 * this software and associated documentation files (the "Software"), to deal in 13 * the Software without restriction, including without limitation the rights to 14 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 15 * the Software, and to permit persons to whom the Software is furnished to do so, 16 * subject to the following conditions: 17 * 18 * The above copyright notice and this permission notice shall be included in all 19 * copies or substantial portions of the Software. 20 * 21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 23 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 24 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 25 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 26 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 28 29 30if touchScroll is false - update index 31 32 */ 33(function (global,factory) { 34 "use strict"; 35 if (typeof define === 'function' && define.amd) { 36 // AMD. Register as an anonymous module. 37 define(['jquery'], function($) { 38 return factory($, global, global.document); 39 }); 40 } else if (typeof module === 'object' && module.exports) { 41 // Node/CommonJS 42 module.exports = factory(require('jquery'), global, global.document); 43 } else { 44 // Browser globals 45 factory(jQuery, global, global.document); 46 } 47}(typeof window !== 'undefined' ? window : this, function ($, window, document, undefined) { 48 "use strict"; 49 var heights = [], 50 names = [], 51 elements = [], 52 overflow = [], 53 index = 0, 54 currentIndex = 0, 55 interstitialIndex = 1, 56 hasLocation = false, 57 timeoutId, 58 timeoutId2, 59 $window = $(window), 60 portHeight, 61 top = $window.scrollTop(), 62 scrollable = false, 63 locked = false, 64 scrolled = false, 65 manualScroll, 66 swipeScroll, 67 util, 68 disabled = false, 69 scrollSamples = [], 70 scrollTime = new Date().getTime(), 71 firstLoad = true, 72 initialised = false, 73 destination = 0, 74 wheelEvent = 'onwheel' in document ? 'wheel' : document.onmousewheel !== undefined ? 'mousewheel' : 'DOMMouseScroll'
vendor: 14,366 bytes, lines 74-521
74, 75 settings = { 76 //section should be an identifier that is the same for each section 77 section: ".section", 78 sectionName: "section-name", 79 interstitialSection: "", 80 easing: "easeOutExpo", 81 scrollSpeed: 1100, 82 offset: 0, 83 scrollbars: true, 84 target:"html,body", 85 standardScrollElements: false, 86 setHeights: true, 87 overflowScroll:true, 88 updateHash: true, 89 touchScroll:true, 90 before:function() {}, 91 after:function() {}, 92 afterResize:function() {}, 93 afterRender:function() {} 94 }; 95 function getportHeight() { 96 return (window.innerHeight + settings.offset); 97 } 98 function animateScroll(index,instant,callbacks,toTop) { 99 if(currentIndex===index) { 100 callbacks = false; 101 } 102 if(disabled===true) { 103 return true; 104 } 105 if(names[index]) { 106 scrollable = false; 107 if(firstLoad===true) { 108 firstLoad = false; 109 settings.afterRender(); 110 } 111 if(callbacks) { 112 if( typeof settings.before == 'function' && settings.before(index,elements) === false ){ 113 return true; 114 } 115 } 116 interstitialIndex = 1; 117 destination = (!index) ? 0 : heights[index]; 118 if(firstLoad===false && currentIndex>index && toTop===false) { 119 //We're going backwards 120 if(overflow[index]) { 121 portHeight = getportHeight(); 122 123 interstitialIndex = parseInt(elements[index].outerHeight()/portHeight); 124 125 destination = parseInt(heights[index])+(elements[index].outerHeight()-portHeight); 126 } 127 } 128 129 130 if(settings.updateHash && settings.sectionName && !(firstLoad===true && index===0)) { 131 if(history.pushState) { 132 try { 133 history.replaceState(null, null, names[index]); 134 } catch (e) { 135 if(window.console) { 136 console.warn("Scrollify warning: Page must be hosted to manipulate the hash value."); 137 } 138 } 139 140 } else { 141 window.location.hash = names[index]; 142 } 143 } 144 145 currentIndex = index; 146 if(instant) { 147 $(settings.target).stop().scrollTop(destination); 148 if(callbacks) { 149 settings.after(index,elements); 150 } 151 } else { 152 locked = true; 153 if( $().velocity ) { 154 $(settings.target).stop().velocity('scroll', { 155 duration: settings.scrollSpeed, 156 easing: settings.easing, 157 offset: destination, 158 mobileHA: false 159 }); 160 } else { 161 $(settings.target).stop().animate({ 162 scrollTop: destination 163 }, settings.scrollSpeed,settings.easing); 164 } 165 166 if(window.location.hash.length && settings.sectionName && window.console) { 167 try { 168 if($(window.location.hash).length) { 169 console.warn("Scrollify warning: ID matches hash value - this will cause the page to anchor."); 170 } 171 } catch (e) {} 172 } 173 $(settings.target).promise().done(function(){ 174 locked = false; 175 firstLoad = false; 176 if(callbacks) { 177 settings.after(index,elements); 178 } 179 }); 180 } 181 182 } 183 } 184 185 function isAccelerating(samples) { 186 function average(num) { 187 var sum = 0; 188 189 var lastElements = samples.slice(Math.max(samples.length - num, 1)); 190 191 for(var i = 0; i < lastElements.length; i++){ 192 sum += lastElements[i]; 193 } 194 195 return Math.ceil(sum/num); 196 } 197 198 var avEnd = average(10); 199 var avMiddle = average(70); 200 201 if(avEnd >= avMiddle) { 202 return true; 203 } else { 204 return false; 205 } 206 } 207 var scrollify = function(options) { 208 initialised = true; 209 $.easing['easeOutExpo'] = function(x, t, b, c, d) { 210 return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; 211 }; 212 213 manualScroll = { 214 handleMousedown:function() { 215 if(disabled===true) { 216 return true; 217 } 218 scrollable = false; 219 scrolled = false; 220 }, 221 handleMouseup:function() { 222 if(disabled===true) { 223 return true; 224 } 225 scrollable = true; 226 if(scrolled) { 227 //instant,callbacks 228 manualScroll.calculateNearest(false,true); 229 } 230 }, 231 handleScroll:function() { 232 if(disabled===true) { 233 return true; 234 } 235 if(timeoutId){ 236 clearTimeout(timeoutId); 237 } 238 239 timeoutId = setTimeout(function(){ 240 scrolled = true; 241 if(scrollable===false) { 242 return false; 243 } 244 scrollable = false; 245 //instant,callbacks 246 manualScroll.calculateNearest(false,true); 247 }, 200); 248 }, 249 calculateNearest:function(instant,callbacks) { 250 top = $window.scrollTop(); 251 var i =1, 252 max = heights.length, 253 closest = 0, 254 prev = Math.abs(heights[0] - top), 255 diff; 256 for(;i<max;i++) { 257 diff = Math.abs(heights[i] - top); 258 259 if(diff < prev) { 260 prev = diff; 261 closest = i; 262 } 263 } 264 if((atBottom() && closest>index) || atTop()) { 265 index = closest; 266 //index, instant, callbacks, toTop 267 animateScroll(closest,instant,callbacks,false); 268 } 269 }, 270 wheelHandler:function(e) { 271 if(disabled===true) { 272 return true; 273 } else if(settings.standardScrollElements) { 274 if($(e.target).is(settings.standardScrollElements) || $(e.target).closest(settings.standardScrollElements).length) { 275 return true; 276 } 277 } 278 if(!overflow[index]) { 279 e.preventDefault(); 280 } 281 var currentScrollTime = new Date().getTime(); 282 283 284 e = e || window.event; 285 var value; 286 if (e.originalEvent) { 287 value = e.originalEvent.wheelDelta || -e.originalEvent.deltaY || -e.originalEvent.detail; 288 } else { 289 value = e.wheelDelta || -e.deltaY || -e.detail; 290 } 291 var delta = Math.max(-1, Math.min(1, value)); 292 293 //delta = delta || -e.originalEvent.detail / 3 || e.originalEvent.wheelDelta / 120; 294 295 if(scrollSamples.length > 149){ 296 scrollSamples.shift(); 297 } 298 //scrollSamples.push(Math.abs(delta*10)); 299 scrollSamples.push(Math.abs(value)); 300 301 if((currentScrollTime-scrollTime) > 200){ 302 scrollSamples = []; 303 } 304 scrollTime = currentScrollTime; 305 306 307 if(locked) { 308 return false; 309 } 310 if(delta<0) { 311 if(index<heights.length-1) { 312 if(atBottom()) { 313 if(isAccelerating(scrollSamples)) { 314 e.preventDefault(); 315 index++; 316 locked = true; 317 //index, instant, callbacks, toTop 318 animateScroll(index,false,true, false); 319 } else { 320 return false; 321 } 322 } 323 } 324 } else if(delta>0) { 325 if(index>0) { 326 if(atTop()) { 327 if(isAccelerating(scrollSamples)) { 328 e.preventDefault(); 329 index--; 330 locked = true; 331 //index, instant, callbacks, toTop 332 animateScroll(index,false,true, false); 333 } else { 334 return false 335 } 336 } 337 } 338 } 339 340 }, 341 keyHandler:function(e) { 342 if(disabled===true || document.activeElement.readOnly===false) { 343 return true; 344 } else if(settings.standardScrollElements) { 345 if($(e.target).is(settings.standardScrollElements) || $(e.target).closest(settings.standardScrollElements).length) { 346 return true; 347 } 348 } 349 if(locked===true) { 350 return false; 351 } 352 if(e.keyCode==38 || e.keyCode==33) { 353 if(index>0) { 354 if(atTop()) { 355 e.preventDefault(); 356 index--; 357 //index, instant, callbacks, toTop 358 animateScroll(index,false,true,false); 359 } 360 } 361 } else if(e.keyCode==40 || e.keyCode==34) { 362 if(index<heights.length-1) { 363 if(atBottom()) { 364 e.preventDefault(); 365 index++; 366 //index, instant, callbacks, toTop 367 animateScroll(index,false,true,false); 368 } 369 } 370 } 371 }, 372 init:function() { 373 if(settings.scrollbars) { 374 $window.on('mousedown', manualScroll.handleMousedown); 375 $window.on('mouseup', manualScroll.handleMouseup); 376 $window.on('scroll', manualScroll.handleScroll); 377 } else { 378 $("body").css({"overflow":"hidden"}); 379 } 380 window.addEventListener(wheelEvent, manualScroll.wheelHandler, { passive: false }); 381 //$(document).bind(wheelEvent,manualScroll.wheelHandler); 382 $window.on('keydown', manualScroll.keyHandler); 383 } 384 }; 385 386 swipeScroll = { 387 touches : { 388 "touchstart": {"y":-1,"x":-1}, 389 "touchmove" : {"y":-1,"x":-1}, 390 "touchend" : false, 391 "direction" : "undetermined" 392 }, 393 options:{ 394 "distance" : 30, 395 "timeGap" : 800, 396 "timeStamp" : new Date().getTime() 397 }, 398 touchHandler: function(event) { 399 if(disabled===true) { 400 return true; 401 } else if(settings.standardScrollElements) { 402 if($(event.target).is(settings.standardScrollElements) || $(event.target).closest(settings.standardScrollElements).length) { 403 return true; 404 } 405 } 406 var touch; 407 if (typeof event !== 'undefined'){ 408 if (typeof event.touches !== 'undefined') { 409 touch = event.touches[0]; 410 switch (event.type) { 411 case 'touchstart': 412 swipeScroll.touches.touchstart.y = touch.pageY; 413 swipeScroll.touches.touchmove.y = -1; 414 415 swipeScroll.touches.touchstart.x = touch.pageX; 416 swipeScroll.touches.touchmove.x = -1; 417 418 swipeScroll.options.timeStamp = new Date().getTime(); 419 swipeScroll.touches.touchend = false; 420 case 'touchmove': 421 swipeScroll.touches.touchmove.y = touch.pageY; 422 swipeScroll.touches.touchmove.x = touch.pageX; 423 if(swipeScroll.touches.touchstart.y!==swipeScroll.touches.touchmove.y && (Math.abs(swipeScroll.touches.touchstart.y-swipeScroll.touches.touchmove.y)>Math.abs(swipeScroll.touches.touchstart.x-swipeScroll.touches.touchmove.x))) { 424 //if(!overflow[index]) { 425 event.preventDefault(); 426 //} 427 swipeScroll.touches.direction = "y"; 428 if((swipeScroll.options.timeStamp+swipeScroll.options.timeGap)<(new Date().getTime()) && swipeScroll.touches.touchend == false) { 429 430 swipeScroll.touches.touchend = true; 431 if (swipeScroll.touches.touchstart.y > -1) { 432 433 if(Math.abs(swipeScroll.touches.touchmove.y-swipeScroll.touches.touchstart.y)>swipeScroll.options.distance) { 434 if(swipeScroll.touches.touchstart.y < swipeScroll.touches.touchmove.y) { 435 436 swipeScroll.up(); 437 438 } else { 439 swipeScroll.down(); 440 441 } 442 } 443 } 444 } 445 } 446 break; 447 case 'touchend': 448 if(swipeScroll.touches[event.type]===false) { 449 swipeScroll.touches[event.type] = true; 450 if (swipeScroll.touches.touchstart.y > -1 && swipeScroll.touches.touchmove.y > -1 && swipeScroll.touches.direction==="y") { 451 452 if(Math.abs(swipeScroll.touches.touchmove.y-swipeScroll.touches.touchstart.y)>swipeScroll.options.distance) { 453 if(swipeScroll.touches.touchstart.y < swipeScroll.touches.touchmove.y) { 454 swipeScroll.up(); 455 456 } else { 457 swipeScroll.down(); 458 459 } 460 } 461 swipeScroll.touches.touchstart.y = -1; 462 swipeScroll.touches.touchstart.x = -1; 463 swipeScroll.touches.direction = "undetermined"; 464 } 465 } 466 default: 467 break; 468 } 469 } 470 } 471 }, 472 down: function() { 473 474 if(index<heights.length) { 475 476 if(atBottom() && index<heights.length-1) { 477 478 index++; 479 //index, instant, callbacks, toTop 480 animateScroll(index,false,true,false); 481 } else { 482 portHeight = getportHeight(); 483 if(Math.floor(elements[index].height()/portHeight)>interstitialIndex) { 484 485 interstitialScroll(parseInt(heights[index])+(portHeight*interstitialIndex)); 486 interstitialIndex += 1; 487 488 } else { 489 interstitialScroll(parseInt(heights[index])+(elements[index].outerHeight()-portHeight)); 490 } 491 492 } 493 } 494 }, 495 up: function() { 496 if(index>=0) { 497 if(atTop() && index>0) { 498 499 index--; 500 //index, instant, callbacks, toTop 501 animateScroll(index,false,true,false); 502 } else { 503 504 if(interstitialIndex>2) { 505 portHeight = getportHeight(); 506 507 interstitialIndex -= 1; 508 interstitialScroll(parseInt(heights[index])+(portHeight*interstitialIndex)); 509 510 } else { 511 512 interstitialIndex = 1; 513 interstitialScroll(parseInt(heights[index])); 514 } 515 } 516 517 } 518 }, 519 init: function() { 520 if (document.addEventListener && settings.touchScroll) { 521
vendor: 9,524 bytes, lines 521-855
521var eventListenerOptions = { 522 passive: false 523 }; 524 document.addEventListener('touchstart', swipeScroll.touchHandler, eventListenerOptions); 525 document.addEventListener('touchmove', swipeScroll.touchHandler, eventListenerOptions); 526 document.addEventListener('touchend', swipeScroll.touchHandler, eventListenerOptions); 527 } 528 } 529 }; 530 531 532 util = { 533 refresh:function(withCallback,scroll) { 534 clearTimeout(timeoutId2); 535 timeoutId2 = setTimeout(function() { 536 //retain position 537 sizePanels(true); 538 //scroll, firstLoad 539 calculatePositions(scroll,false); 540 if(withCallback) { 541 settings.afterResize(); 542 } 543 },400); 544 }, 545 handleUpdate:function() { 546 //callbacks, scroll 547 //changed from false,true to false,false 548 util.refresh(false,false); 549 }, 550 handleResize:function() { 551 //callbacks, scroll 552 util.refresh(true,false); 553 }, 554 handleOrientation:function() { 555 //callbacks, scroll 556 util.refresh(true,true); 557 } 558 }; 559 settings = $.extend(settings, options); 560 561 //retain position 562 sizePanels(false); 563 564 calculatePositions(false,true); 565 566 if(true===hasLocation) { 567 //index, instant, callbacks, toTop 568 animateScroll(index,false,true,true); 569 } else { 570 setTimeout(function() { 571 //instant,callbacks 572 manualScroll.calculateNearest(true,false); 573 },200); 574 } 575 if(heights.length) { 576 manualScroll.init(); 577 swipeScroll.init(); 578 579 $window.on("resize",util.handleResize); 580 if (document.addEventListener) { 581 window.addEventListener("orientationchange", util.handleOrientation, false); 582 } 583 } 584 function interstitialScroll(pos) { 585 if( $().velocity ) { 586 $(settings.target).stop().velocity('scroll', { 587 duration: settings.scrollSpeed, 588 easing: settings.easing, 589 offset: pos, 590 mobileHA: false 591 }); 592 } else { 593 $(settings.target).stop().animate({ 594 scrollTop: pos 595 }, settings.scrollSpeed,settings.easing); 596 } 597 } 598 599 function sizePanels(keepPosition) { 600 if(keepPosition) { 601 top = $window.scrollTop(); 602 } 603 604 var selector = settings.section; 605 overflow = []; 606 if(settings.interstitialSection.length) { 607 selector += "," + settings.interstitialSection; 608 } 609 if(settings.scrollbars===false) { 610 settings.overflowScroll = false; 611 } 612 portHeight = getportHeight(); 613 $(selector).each(function(i) { 614 var $this = $(this); 615 616 if(settings.setHeights) { 617 if($this.is(settings.interstitialSection)) { 618 overflow[i] = false; 619 } else { 620 if(($this.css("height","auto").outerHeight()<portHeight) || $this.css("overflow")==="hidden") { 621 $this.css({"height":portHeight}); 622 623 overflow[i] = false; 624 } else { 625 626 $this.css({"height":$this.outerHeight()}); 627 628 if(settings.overflowScroll) { 629 overflow[i] = true; 630 } else { 631 overflow[i] = false; 632 } 633 } 634 635 } 636 637 } else { 638 639 if(($this.outerHeight()<portHeight) || (settings.overflowScroll===false)) { 640 overflow[i] = false; 641 } else { 642 overflow[i] = true; 643 } 644 } 645 }); 646 if(keepPosition) { 647 $window.scrollTop(top); 648 } 649 } 650 function calculatePositions(scroll,firstLoad) { 651 var selector = settings.section; 652 if(settings.interstitialSection.length) { 653 selector += "," + settings.interstitialSection; 654 } 655 heights = []; 656 names = []; 657 elements = []; 658 $(selector).each(function(i){ 659 var $this = $(this); 660 if(i>0) { 661 heights[i] = parseInt($this.offset().top) + settings.offset; 662 } else { 663 heights[i] = parseInt($this.offset().top); 664 } 665 if(settings.sectionName && $this.data(settings.sectionName)) { 666 names[i] = "#" + $this.data(settings.sectionName).toString().replace(/ /g,"-"); 667 } else { 668 if($this.is(settings.interstitialSection)===false) { 669 names[i] = "#" + (i + 1); 670 } else { 671 names[i] = "#"; 672 if(i===$(selector).length-1 && i>1) { 673 heights[i] = heights[i-1] + (parseInt($($(selector)[i-1]).outerHeight()) - parseInt($(window).height())) + parseInt($this.outerHeight()); 674 } 675 } 676 } 677 elements[i] = $this; 678 try { 679 if($(names[i]).length && window.console) { 680 console.warn("Scrollify warning: Section names can't match IDs - this will cause the browser to anchor."); 681 } 682 } catch (e) {} 683 684 if(window.location.hash===names[i]) { 685 index = i; 686 hasLocation = true; 687 } 688 689 }); 690 691 if(true===scroll) { 692 //index, instant, callbacks, toTop 693 animateScroll(index,false,false,false); 694 } 695 } 696 697 function atTop() { 698 if(!overflow[index]) { 699 return true; 700 } 701 top = $window.scrollTop(); 702 if(top>parseInt(heights[index])) { 703 return false; 704 } else { 705 return true; 706 } 707 } 708 function atBottom() { 709 if(!overflow[index]) { 710 return true; 711 } 712 top = $window.scrollTop(); 713 portHeight = getportHeight(); 714 715 if(top<parseInt(heights[index])+(elements[index].outerHeight()-portHeight)-28) { 716 717 return false; 718 719 } else { 720 return true; 721 } 722 } 723 } 724 725 function move(panel,instant) { 726 var z = names.length; 727 for(;z>=0;z--) { 728 if(typeof panel === 'string') { 729 if (names[z]===panel) { 730 index = z; 731 //index, instant, callbacks, toTop 732 animateScroll(z,instant,true,true); 733 } 734 } else { 735 if(z===panel) { 736 index = z; 737 //index, instant, callbacks, toTop 738 animateScroll(z,instant,true,true); 739 } 740 } 741 } 742 } 743 scrollify.move = function(panel) { 744 if(panel===undefined) { 745 return false; 746 } 747 if(panel.originalEvent) { 748 panel = $(this).attr("href"); 749 } 750 move(panel,false); 751 }; 752 scrollify.instantMove = function(panel) { 753 if(panel===undefined) { 754 return false; 755 } 756 move(panel,true); 757 }; 758 scrollify.next = function() { 759 if(index<names.length) { 760 index += 1; 761 //index, instant, callbacks, toTop 762 animateScroll(index,false,true,true); 763 } 764 }; 765 scrollify.previous = function() { 766 if(index>0) { 767 index -= 1; 768 //index, instant, callbacks, toTop 769 animateScroll(index,false,true,true); 770 } 771 }; 772 scrollify.instantNext = function() { 773 if(index<names.length) { 774 index += 1; 775 //index, instant, callbacks, toTop 776 animateScroll(index,true,true,true); 777 } 778 }; 779 scrollify.instantPrevious = function() { 780 if(index>0) { 781 index -= 1; 782 //index, instant, callbacks, toTop 783 animateScroll(index,true,true,true); 784 } 785 }; 786 scrollify.destroy = function() { 787 if(!initialised) { 788 return false; 789 } 790 if(settings.setHeights) { 791 $(settings.section).each(function() { 792 $(this).css("height","auto"); 793 }); 794 } 795 $window.off("resize",util.handleResize); 796 if(settings.scrollbars) { 797 $window.off('mousedown', manualScroll.handleMousedown); 798 $window.off('mouseup', manualScroll.handleMouseup); 799 $window.off('scroll', manualScroll.handleScroll); 800 } 801 // $window.off(wheelEvent,manualScroll.wheelHandler); 802 window.removeEventListener(wheelEvent,manualScroll.wheelHandler); 803 $window.off('keydown', manualScroll.keyHandler); 804 805 if (document.addEventListener && settings.touchScroll) { 806 document.removeEventListener('touchstart', swipeScroll.touchHandler, false); 807 document.removeEventListener('touchmove', swipeScroll.touchHandler, false); 808 document.removeEventListener('touchend', swipeScroll.touchHandler, false); 809 } 810 heights = []; 811 names = []; 812 elements = []; 813 overflow = []; 814 firstLoad=true; 815 initialised=false; 816 }; 817 scrollify.update = function() { 818 if(!initialised) { 819 return false; 820 } 821 util.handleUpdate(); 822 }; 823 scrollify.current = function() { 824 return elements[index]; 825 }; 826 scrollify.currentIndex = function() { 827 return index; 828 }; 829 scrollify.disable = function() { 830 disabled = true; 831 }; 832 scrollify.enable = function() { 833 disabled = false; 834 if (initialised) { 835 //instant,callbacks 836 manualScroll.calculateNearest(false,false); 837 } 838 }; 839 scrollify.isDisabled = function() { 840 return disabled; 841 }; 842 scrollify.setOptions = function(updatedOptions) { 843 if(!initialised) { 844 return false; 845 } 846 if(typeof updatedOptions === "object") { 847 settings = $.extend(settings, updatedOptions); 848 util.handleUpdate(); 849 } else if(window.console) { 850 console.warn("Scrollify warning: setOptions expects an object."); 851 } 852 }; 853 $.scrollify = scrollify; 854 return scrollify; 855}));
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.