function scroll(){} scroll.prototype.upscroll=function(dom,_h,interval){ var dom=document.getelementbyid(dom); var timer=settimeout(function(){ var _field=dom.firstelementchild; _field.style.margintop=_h; cleartimeout(timer); },1000) setinterval(function(){ var _field=dom.firstelementchild; _field.style.margintop="0px"; dom.appendchild(_field); var _field=dom.firstelementchild _field.style.margintop=_h; },interval) } var myscroll=new scroll();