Ok here's what I got,
Only problem is now the menu boxes overlap when compressed, and have an
extra space when expanded. Not too big of a problem, but probably solvable.
It IS faster though, much more managable.
Now that many have high speed networks, and faster computers who wants to
wait for a slow menu that acts as if it's on a 486?
------------------------clipped script------------------------
function epull_down(nr,to,nowv)
{
name = "down" + (nr-1);
obj = document.getElementById(name).style.clip =
"rect(0,"+width+","+(+nowv+1)+",0)";
for (i=nr;i<self_menu.length;i++)
{
name = "down" + i;
obj = document.getElementById(name);
obj.style.top =Math.max(parseInt(obj.style.top,10)+5,0)+"px";
}
nowv+=5;
if(nowv < to) timerID =
setTimeout("epull_down("+nr+","+to+","+nowv+")",sp eed);
else timerID = "";
}
function epull_up(nr,to,nowv)
{
name = "down" + (nr-1);
obj = document.getElementById(name).style.clip =
"rect(0,"+width+","+nowv+",0)";
for (i=nr;i<self_menu.length;i++)
{
name = "down" + i;
obj = document.getElementById(name);
obj.style.top = Math.max(parseInt(obj.style.top,10)-5,0)+"px";
}
nowv-=5;
if(nowv > to) timerID =
setTimeout("epull_up("+nr+","+to+","+nowv+")",spee d);
else timerID = "";
-------------------------end cliped script---------------
"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message
news:8y**********@hotpop.com...
"gregory stevenson" <gr********@hotmail.com> writes:
This is the only decent one I've been able to find.
http://www.bravenet.com/resources/sc...d=92&cat_name=
I would be worried using it. I can see a few bad methods used, e.g.,
setting the obj.style.top without a unit, which *will* fail in most
browsers in standards mode.
If you check out the demo you'll notice it's very slow. It has a speed
variable but it only seems to make it slower.
Yes
If anyone knows how to speed up the first one, or knows of another
SIMPLE expanding cascading script please let me know.
The speed is used as the second argument of the setTimeout, and
defaults to 0, so that's as fast as it gets.
What you can do, is to change by how many pixles it moves per timeout.
I.e., the line
obj.style.top = parseInt(obj.style.top)-1;
can be changed to
obj.style.top = Math.max(parseInt(obj.style.top,10)-5,0) + "px";
A line furter down reads
nowv--;
Change that to
nowv-=5;
and it moves five times as fast when it closes. There is probably an
equivalent code for moving down.
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors:
<URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html> 'Faith without judgement merely degrades the spirit divine.'