IMHO.WS

IMHO.WS (http://www.imho.ws/index.php)
-   Веб-программирование (http://www.imho.ws/forumdisplay.php?f=29)
-   -   javascript: разворачивание слоёв. доработка функции (http://www.imho.ws/showthread.php?t=66147)

Wozik 12.08.2004 18:39

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);}}
первая работает прекрасно, а вторая не работает
помогите плиз найти ошибку, ато уже замучался...


Часовой пояс GMT +4, время: 18:40.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.