/** * Author : MC ½É»õ (ganer9r@naver.com) * Make Date : 2008-07-15 * comment : 1ÁÙ ÅØ½ºÆ® ·Ñ¸µ ½ºÅ©¸³Æ® **/ var ScrollControl = function(objId,options){ this.init(objId,options); } ScrollControl.prototype = { stage : {}, options : {}, isover : false, freeze : false, course : 'top', itimes : 0, top : 0, init : function(objId,options){ this.setOptions(options); this.setStage(objId); this.setTrueData(); this.move(); }, setOptions : function(options){ options.inteval = options.inteval || 50; options.freeze = options.freeze || 1000; options.height = parseInt(options.height, 10) || 20; options.style = options.style || 'scroll'; options.line = options.line || 1; options.stopline = options.stopline || options.line; options.reverse = options.reverse || ''; options.debug = options.debug || false; options.blockHeight = options.height * options.line; options.stopHeight = options.height * (options.stopline || options.line); // options.cMarginTop = options.cMarginTop || (options.height/2) * 0.3; options.cMarginTop = 0; options.cHeight = options.height - options.cMarginTop; options.freeze = (options.style == 'no-freeze') ? options.inteval : options.freeze; switch(options.style){ case 'jump' : options.style = options.style; break; default : options.style = 'scroll'; break; } this.course = options.start || 'top'; this.options = options; }, setTrueData : function(){ var cObjs = this.stage.childNodes; var cObjLen = cObjs.length; var removes = []; for(var i=0;i= this.options.height){ if(this.options.reverse != 'all'){ this.changeChild(this.options.line); this.stage.scrollTop = this.stage.scrollTop - this.options.stopHeight; } } this.course = course; if(this.itimes > 0){ window.clearTimeout(this.itimes); this.move(); } }, changeChild : function(count){ if(count == undefined){ count = this.stage.childNodes.length - 1;} for(var i=0; i= this.options.height ){ this.changeChild(1); this.stage.scrollTop = this.stage.scrollTop - this.options.height; //if¹® ¾È¿¡ ÀÖ´Â°Ô È¿À² if( this.top >= this.options.stopHeight ){ this.top = 0; this.freeze = true; if(this.options.reverse == 'top' || this.options.reverse == 'all') this.setCourse("down"); } } } }, actionDown : function(){ if(this.options.style == 'jump'){ this.freeze = true; for(var i=0; i= this.options.stopHeight ){ for(var i=1; i