/******************************************************************* * * File : JSFX_FloatingLayer.js © JavaScript-FX.com * * Created : 2001/03/16 * * Author : Roy Whittle www.Roy.Whittle.com * * Purpose : To make and positional div float to * one plave on the page and stay there. * * History * Date Version Description * * 2001-03-17 2.0 Converted for javascript-fx ***********************************************************************/ JSFX.FloatingLayer = function(theDiv, x, y, bdy_height) { //Call the superclass constructor this.superC = JSFX.Layer; this.superC(JSFX.findLayer(theDiv), x, y, bdy_height); this.bdy_height = bdy_height; this.theDiv = theDiv this.baseX = x; this.baseY = y; this.x = x; this.y = y; //this.moveTo(x,y); //this.show(); } JSFX.FloatingLayer.prototype = new JSFX.Layer; JSFX.FloatingLayer.prototype.animate = function() { if (menustop != 1) { var cell; var menu_height; var diff; var absdiff; var stepval; if (document.getElementById) { cell = document.getElementById(this.theDiv); } else if (document.all) { cell = document.all[this.theDiv]; } if (cell) { menu_height = cell.offsetHeight; } if(this.baseY > 0) { targetY = JSFX.Browser.getMinY() + this.baseY; } else { targetY = JSFX.Browser.getMaxY() + this.baseY; } this.y = Math.round(this.y); diff = Math.round(targetY - this.y); absdiff = Math.abs(diff); var exponent = 3; var highestnuminrange = 80; var highestval = this.bdy_height * this.bdy_height * this.bdy_height * this.bdy_height; stepval = highestnuminrange + (absdiff * absdiff * absdiff * absdiff * ( highestnuminrange - .01 )) / highestval; var dy = diff / stepval; this.y += dy; lowesty = menu_height + this.y; // make sure we have room to move the menu. if (this.bdy_height > lowesty) { this.paddY(this.y); } } } JSFX.MakeFloatingLayer = function(theDiv, x, y, bdy_height) { JSFX.MakeFloatingLayer.floaters[JSFX.MakeFloatingLayer.floaters.length] = new JSFX.FloatingLayer(theDiv, x, y, bdy_height); } JSFX.MakeFloatingLayer.floaters = new Array(); JSFX.MakeFloatingLayer.animate = function() { var i; for(i=0 ; i