javascript: разворачивание слоёв. доработка функции
есть две аналогичные функции:
1) для разворачивания слоя
Цитата:
function showtip(layername,xstp,ystp,deltime,stopw,stoph){
var ss=parent.document.all[layername].visibility;
if (ss!="visible"){
curh=0;curw=0;
curlayer=layername;
xstep=xstp;ystep=ystp;
stopww=stopw;stophh=stoph;
delay=deltime;
showlayer(layername);
unpacklayer();
parent.document.all[layername].visibility="visible"}}
function unpacklayer(){
eval('parent.document.all["'+curlayer+'"].style.clip="rect(0 '+curw+'px '+curh+'px 0)"');
curw+=xstep;
curh+=ystep;
if(curw>stopww){curw=stopww;}
if(curh>stophh){curh=stophh;}
if(curw!=stopww | curh!=stophh){setTimeout("unpacklayer()",delay);}}
|
2) для сворачивания:
Цитата:
function hidetip(layername1,xstp,ystp,deltime,stopw,stoph){
curh1=stoph;curw1=stopw;
curlayer1=layername1;
xstep1=xstp;ystep1=ystp;
delay=deltime;
showlayer(curlayer1);
packlayer(curh1,curw1,xstep1,ystep1,delay);
hidelayer(curlayer1);}
function packlayer(curh1,curw1,xstep1,ystep1,delay){
eval('parent.document.all["'+curlayer+'"].style.clip="rect(0 '+curw+'px '+curh+'px 0)"');
curw1-=xstep1;
curh1-=ystep1;
if(curw1<0){curw1=0;}
if(curh1<0){curh1=0;}
if(curw1!=0 | curh1!=0){setTimeout("packlayer(curh1,curw1,xstep1,ystep1,delay)",dela y);}}
|
первая работает прекрасно, а вторая не работает
помогите плиз найти ошибку, ато уже замучался...
|