Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with variables

Status
Not open for further replies.

unicorn11

Programmer
Jun 10, 2000
392
IN
Hi Guys
i have to create a script that is going to send 3+ layers scrolling across the page here is the script

function moveLayers(lay,t1) {
if (t1 == 1) {
t1 = 2
te2(lay);
}
lay2 = lay
var navv = navigator.appName
if (navv == "Netscape") {
var tet = document.layers[lay]
var leeft = tet.left;
if (leeft < 500) {
tet.left = (tet.left + 10);
}
} else {
tet = document.all[lay].style
leeft = tet.pixelLeft
if (leeft < 500) {
tet.pixelLeft = tet.pixelLeft + 10;
}
}
var ab = &quot;moveLayers('&quot;+lay+&quot;',&quot;+t1+&quot;)&quot;;
setTimeout(ab,40);
}

function te2(layed) {
var navv = navigator.appName
if (layed == &quot;abhi&quot;) {
if (navv == &quot;Netscape&quot;) {
document.layers['abhi1'].left = 50
document.layers['abhi2'].left = 50
} else {
document.all['abhi1'].style.pixelLeft = 50
document.all['abhi2'].style.pixelLeft = 50
}
} else if (layed == &quot;abhi1&quot;) {
if (navv == &quot;Netscape&quot;) {
document.layers['abhi'].left = 50
document.layers['abhi2'].left = 50
} else {
document.all['abhi'].style.pixelLeft = 50
document.all['abhi2'].style.pixelLeft = 50
}
} else if (layed == &quot;abhi2&quot;) {
if (navv == &quot;Netscape&quot;) {
document.layers['abhi1'].left = 50
document.layers['abhi'].left = 50
} else {
document.all['abhi1'].style.pixelLeft = 50
document.all['abhi'].style.pixelLeft = 50
}
}
//alert(&quot;hi&quot;)
}


now the problem is that when we send a 1 layer accross the page the remaining ones must go to a certain place as per the script 50 pix fron the left of the page

but when the script is called a second time
it cause a error it calls both the variables the first and the second and causes a loop and the page has to be then reloaded

please check the page on
thanks in advance
regards
Unicorn11
unicorn11@mailcity.com

[red]Luck is not chance, it's toil; fortune's expensive
smile is earned.[red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top