1/** 2 * @copyright Copyright (c) 2013 Skyline Software (http://extstore.com). All rights reserved. 3 * @license GNU General Public License version 2 or later; see LICENSE.txt 4 */ 5 6var Skyline_ScrollToTop = new Class({ 7 Implements: [Options], 8 9 options: { 10 'id': 'scrollToTop', 11 'className': 'scrollToTop', 12 'image': '', 13 'text': '^ Scroll to Top', 14 'title': 'Scroll to Top', 15 'transition': Fx.Transitions.linear, 16 'duration': 500 17 }, 18 19 initialize: function(options) { 20 this.setOptions(options); 21 22 // Create scroll FX 23 this.scrollFx = new Fx.Scroll(window, { 24 transition: this.options.transition, 25 duration: this.options.duration 26 }); 27 28 // Create 'Scroll to Top' link and insert it to body 29 this.scrollLink = new Element('a', { 30 'id': this.options.id, 31 'html': this.options.text, 32 'title': this.options.title, 33 'class': this.options.className, 34 'styles': { 35 'visibility': 'hidden', 36 'opacity': 0 37 }, 38 'events': { 39 // Scroll to top on click 40 click: function() { 41 this.scrollFx.toTop(); 42 }.bind(this) 43 } 44 }).inject(document.id(document.body)); 45 46 if (this.options.image != '') { 47 new Element('img', { 48 'src': this.options.image, 49 'alt': this.options.title 50 }).inject(this.scrollLink, 'top'); 51 } 52 53 // Show/Hide 'Scroll to Top' link 54 if (window.getScrollTop() != 0) { 55 this.scrollLink.fade(1); 56 } 57 58 window.addEvent('scroll', function() { 59 var flag = this.scrollLink.getStyle('visibility') == 'visible'; 60 61 if (window.getScrollTop() != 0 && !flag) { 62 this.scrollLink.fade(1); 63 } else if (window.getScrollTop() == 0 && flag) { 64 this.scrollLink.fade(0); 65 } 66 }.bind(this)); 67 } 68});
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.