PageSourceSearch

https://m-sol.kr/jquery/jquery.tinyscrollbar.min.js?1789361064

js m-sol.kr collected 2026-10-02 00:21:54 UTC 9,844 bytes, 145 lines download raw bytes

1/*!
2 * Tiny Scrollbar 1.66
3 * http://www.baijs.nl/tinyscrollbar/
4 *
5 * Copyright 2010, Maarten Baijs
6 * Dual licensed under the MIT or GPL Version 2 licenses.
7 * http://www.opensource.org/licenses/mit-license.php
8 * http://www.opensource.org/licenses/gpl-2.0.php
9 *
10 * Date: 13 / 11 / 2011
11 * Depends on library: jQuery
12 * 
13 */
14
15(function($){
16	$.tiny = $.tiny || { };
17	
18	$.tiny.scrollbar = {
19		options: {	
20			axis: 'y', // vertical or horizontal scrollbar? ( x || y ).
21			wheel: 40,  //how many pixels must the mouswheel scroll at a time.
22			scroll: true, //enable or disable the mousewheel;
23			size: 'auto', //set the size of the scrollbar to auto or a fixed number.
24			sizethumb: 'auto' //set the size of the thumb to auto or a fixed number.
25		}
26	};	
27	
28	$.fn.tinyscrollbar = function(options) { 
29		var options = $.extend({}, $.tiny.scrollbar.options, options); 		
30		this.each(function(){ $(this).data('tsb', new Scrollbar($(this), options)); });
31		return this;
32	};
33	$.fn.tinyscrollbar_update = function(sScroll) { return $(this).data('tsb').update(sScroll); };
34	
35	function Scrollbar(root, options){
36		var oSelf = this;
37		var oWrapper = root;
38		var oViewport = { obj: $('.viewport', root) };
39		var oContent = { obj: $('.overview', root) };
40		var oScrollbar = { obj: $('.scrollbar', root) };
41		var oTrack = { obj: $('.track', oScrollbar.obj) };
42		var oThumb = { obj: $('.thumb', oScrollbar.obj) };
43		var sAxis = options.axis == 'x', sDirection = sAxis ? 'left' : 'top', sSize = sAxis ? 'Width' : 'Height';
44		var iScroll, iPosition = { start: 0, now: 0 }, iMouse = {};
45
46		function initialize() {
47			oSelf.update();
48			setEvents();
49			return oSelf;
50		}
51		this.update = function(sScroll){
52			oViewport[options.axis] = oViewport.obj[0]['offset'+ sSize];
53			oContent[options.axis] = oContent.obj[0]['scroll'+ sSize];
54			oContent.ratio = oViewport[options.axis] / oContent[options.axis];
55			oScrollbar.obj.toggleClass('disable', oContent.ratio >= 1);
56			oTrack[options.axis] = options.size == 'auto' ? oViewport[options.axis] : options.size;
57			oThumb[options.axis] = Math.min(oTrack[options.axis], Math.max(0, ( options.sizethumb == 'auto' ? (oTrack[options.axis] * oContent.ratio) : options.sizethumb )));
58			oScrollbar.ratio = options.sizethumb == 'auto' ? (oContent[options.axis] / oTrack[options.axis]) : (oContent[options.axis] - oViewport[options.axis]) / (oTrack[options.axis] - oThumb[options.axis]);
59			iScroll = (sScroll == 'relative' && oContent.ratio <= 1) ? Math.min((oContent[options.axis] - oViewport[options.axis]), Math.max(0, iScroll)) : 0;
60			iScroll = (sScroll == 'bottom' && oContent.ratio <= 1) ? (oContent[options.axis] - oViewport[options.axis]) : isNaN(parseInt(sScroll)) ? iScroll : parseInt(sScroll);
61			setSize();
62			if(oContent[options.axis]+2 <= oViewport[options.axis]){$('#scrollbar_wrap').hide();}else{$('#scrollbar_wrap').show();};
63		};
64		function setSize(){
65			oThumb.obj.css(sDirection, iScroll / oScrollbar.ratio);
66			oContent.obj.css(sDirection, -iScroll);
67			iMouse['start'] = oThumb.obj.offset()[sDirection];
68			var sCssSize = sSize.toLowerCase(); 
69			oScrollbar.obj.css(sCssSize, oTrack[options.axis]);
70			oTrack.obj.css(sCssSize, oTrack[options.axis]);
71			oThumb.obj.css(sCssSize, oThumb[options.axis]);		
72		};		
73		function setEvents(){	
74			oThumb.obj.bind('mousedown', start);
75			oThumb.obj[0].ontouchstart = function(oEvent){
76				oEvent.preventDefault();
77				oThumb.obj.unbind('mousedown');
78				start(oEvent.touches[0]);
79				return false;
80			};	
81			oTrack.obj.bind('mouseup', drag);
82			if(options.scroll && this.addEventListener){
83				oWrapper[0].addEventListener('DOMMouseScroll', wheel, false);
84				oWrapper[0].addEventListener('mousewheel', wheel, false );
85			}
86			else if(options.scroll){oWrapper[0].onmousewheel = wheel;}
87		};
88		function start(oEvent){
89			iMouse.start = sAxis ? oEvent.pageX : oEvent.pageY;
90			var oThumbDir = parseInt(oThumb.obj.css(sDirection));
91			iPosition.start = oThumbDir == 'auto' ? 0 : oThumbDir;
92			$(document).bind('mousemove', drag);
93			document.ontouchmove = function(oEvent){
94				$(document).unbind('mousemove');
95				drag(oEvent.touches[0]);
96			};
97			$(document).bind('mouseup', end);
98			oThumb.obj.bind('mouseup', end);
99			oThumb.obj[0].ontouchend = document.ontouchend = function(oEvent){
100				$(document).unbind('mouseup');
101				oThumb.obj.unbind('mouseup');
102				end(oEvent.touches[0]);
103			};
104			return false;
105		};		
106		function wheel(oEvent){
107			if(!(oContent.ratio >= 1)){
108				var oEvent = oEvent || window.event;
109				var iDelta = oEvent.wheelDelta ? oEvent.wheelDelta/120 : -oEvent.detail/3;
110				iScroll -= iDelta * options.wheel;
111				iScroll = Math.min((oContent[options.axis] - oViewport[options.axis]), Math.max(0, iScroll));
112				oThumb.obj.css(sDirection, iScroll / oScrollbar.ratio);
113				oContent.obj.css(sDirection, -iScroll);
114				
115				oEvent = $.event.fix(oEvent);
116				oEvent.preventDefault();
117			};
118		};
119		function end(oEvent){
120			$(document).unbind('mousemove', drag);
121			$(document).unbind('mouseup', end);
122			oThumb.obj.unbind('mouseup', end);
123			document.ontouchmove = oThumb.obj[0].ontouchend = document.ontouchend = null;
124			return false;
125		};
126		function drag(oEvent){
127			if(!(oContent.ratio >= 1)){
128				iPosition.now = Math.min((oTrack[options.axis] - oThumb[options.axis]), Math.max(0, (iPosition.start + ((sAxis ? oEvent.pageX : oEvent.pageY) - iMouse.start))));
129				iScroll = iPosition.now * oScrollbar.ratio;
130				oContent.obj.css(sDirection, -iScroll);
131				oThumb.obj.css(sDirection, iPosition.now);
132			}
133			return false;
134		};
135		
136		return initialize();
137	};
138})(jQuery);
139/*
140(function($){$.tiny=$.tiny||{};$.tiny.scrollbar={options:{axis:'y',wheel:60,scroll:true,size:'auto',sizethumb:'auto'}};$.fn.tinyscrollbar=function(options){var options=$.extend({},$.tiny.scrollbar.options,options);this.each(function(){$(this).data('tsb',new Scrollbar($(this),options));});return this;};$.fn.tinyscrollbar_update=function(sScroll){return $(this).data('tsb').update(sScroll);};function Scrollbar(root,options){var oSelf=this;var oWrapper=root;var oViewport={obj:$('.viewport',root)};var oContent={obj:$('.overview',root)};var oScrollbar={obj:$('.scrollbar',root)};var oTrack={obj:$('.track',oScrollbar.obj)};var oThumb={obj:$('.thumb',oScrollbar.obj)};var sAxis=options.axis=='x',sDirection=sAxis?'left':'top',sSize=sAxis?'Width':'Height';var iScroll,iPosition={start:0,now:0},iMouse={};function initialize(){oSelf.update();setEvents();return oSelf;}
141this.update=function(sScroll){oViewport[options.axis]=oViewport.obj[0]['offset'+sSize];oContent[options.axis]=oContent.obj[0]['scroll'+sSize];oContent.ratio=oViewport[options.axis]/oContent[options.axis];oScrollbar.obj.toggleClass('disable',oContent.ratio>=1);oTrack[options.axis]=options.size=='auto'?oViewport[options.axis]:options.size;oThumb[options.axis]=Math.min(oTrack[options.axis],Math.max(0,(options.sizethumb=='auto'?(oTrack[options.axis]*oContent.ratio):options.sizethumb)));oScrollbar.ratio=options.sizethumb=='auto'?(oContent[options.axis]/oTrack[options.axis]):(oContent[options.axis]-oViewport[options.axis])/(oTrack[options.axis]-oThumb[options.axis]);iScroll=(sScroll=='relative'&&oContent.ratio<=1)?Math.min((oContent[options.axis]-oViewport[options.axis]),Math.max(0,iScroll)):0;iScroll=(sScroll=='bottom'&&oContent.ratio<=1)?(oContent[options.axis]-oViewport[options.axis]):isNaN(parseInt(sScroll))?iScroll:parseInt(sScroll);setSize();/////////////////////////////////alert(oContent[options.axis]); 
142if(oContent[options.axis]+2 <= oViewport[options.axis]){$('#scrollbar_wrap').hide();}else{$('#scrollbar_wrap').show();};
143};function setSize(){oThumb.obj.css(sDirection,iScroll/oScrollbar.ratio);oContent.obj.css(sDirection,-iScroll);iMouse['start']=oThumb.obj.offset()[sDirection];var sCssSize=sSize.toLowerCase();oScrollbar.obj.css(sCssSize,oTrack[options.axis]);oTrack.obj.css(sCssSize,oTrack[options.axis]);oThumb.obj.css(sCssSize,oThumb[options.axis]);};function setEvents(){oThumb.obj.bind('mousedown',start);oThumb.obj[0].ontouchstart=function(oEvent){oEvent.preventDefault();oThumb.obj.unbind('mousedown');start(oEvent.touches[0]);return false;};oTrack.obj.bind('mouseup',drag);if(options.scroll&&this.addEventListener){oWrapper[0].addEventListener('DOMMouseScroll',wheel,false);oWrapper[0].addEventListener('mousewheel',wheel,false);}
144else if(options.scroll){oWrapper[0].onmousewheel=wheel;}};function start(oEvent){iMouse.start=sAxis?oEvent.pageX:oEvent.pageY;var oThumbDir=parseInt(oThumb.obj.css(sDirection));iPosition.start=oThumbDir=='auto'?0:oThumbDir;$(document).bind('mousemove',drag);document.ontouchmove=function(oEvent){$(document).unbind('mousemove');drag(oEvent.touches[0]);};$(document).bind('mouseup',end);oThumb.obj.bind('mouseup',end);oThumb.obj[0].ontouchend=document.ontouchend=function(oEvent){$(document).unbind('mouseup');oThumb.obj.unbind('mouseup');end(oEvent.touches[0]);};return false;};function wheel(oEvent){if(!(oContent.ratio>=1)){oEvent=$.event.fix(oEvent||window.event);var iDelta=oEvent.wheelDelta?oEvent.wheelDelta/120:-oEvent.detail/3;iScroll-=iDelta*options.wheel;iScroll=Math.min((oContent[options.axis]-oViewport[options.axis]),Math.max(0,iScroll));oThumb.obj.css(sDirection,iScroll/oScrollbar.ratio);oContent.obj.css(sDirection,-iScroll);oEvent.preventDefault();};};function end(oEvent){$(document).unbind('mousemove',drag);$(document).unbind('mouseup',end);oThumb.obj.unbind('mouseup',end);document.ontouchmove=oThumb.obj[0].ontouchend=document.ontouchend=null;return false;};function drag(oEvent){if(!(oContent.ratio>=1)){iPosition.now=Math.min((oTrack[options.axis]-oThumb[options.axis]),Math.max(0,(iPosition.start+((sAxis?oEvent.pageX:oEvent.pageY)-iMouse.start))));iScroll=iPosition.now*oScrollbar.ratio;oContent.obj.css(sDirection,-iScroll);oThumb.obj.css(sDirection,iPosition.now);;}
145return false;};return initialize();};})(jQuery);*/

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.