/* * app scale v1.0 beta build 090301 copyright (c) 2009 ilwave ce. http://ilwave.spaces.live.com * * this class is part of lib - a javascript library which is still on designing, and is an extend copy of class "object" in lib. * before using this class, you might include lib.common.js and lib.physical.js first. * * 注意:本类需要 lib.common.js 和 lib.physical.js 的支持。 * */ var scale = object.extend({ construct: function(oframediv, obuttondiv, nheight) { this.oframediv = oframediv; this.obuttondiv = obuttondiv; this.nheight = nheight; this.currframe = -1; this.ntargetframe = -1; this.arrbuttons = []; this.odelay = null; var _this = this; var nframes = page.navigator < 3 ? oframediv.childnodes.length : (oframediv.childnodes.length - 1) / 2; for (var i=1; i<=nframes; i++) { var thebutton = document.createelement("a"); thebutton.tabindex = i; thebutton.classname = "s-normal"; thebutton.href = "javascript:void(0)"; thebutton.innerhtml = i; thebutton.onmouseover = function() { var ntabindex = this.tabindex; var ntargetframe = ntabindex-1; _this.ntargetframe = ntargetframe; _this.odelay && window.cleartimeout(_this.odelay); _this.odelay = window.settimeout(function(){_this.doscale(ntargetframe);}, 200); }; thebutton.onmouseout = function() { _this.autoscale(); }; obuttondiv.appendchild(thebutton) && this.arrbuttons.push(thebutton); if (this.currframe == -1) { this.currframe = 0; this.highlight(0); } } this.autoscale(); }, scaleto: function(nframe) { var ncurrtop = this.currframe * this.nheight; var arrsteplist = physical.smooth(ncurrtop, nframe * this.nheight, 20, 0); for(var i=0; i