theEclipse
Programmer
OK OK OK.<br>
Here's the deal:<br>
<br>
I have scripts that I will post at my website for people to use on their site. kind of a library type of thing. I have written the scripts, and they work fine. I also personally use the scripts on my pages (makes sense). and here is the problem. The script works fine on page A, but not page B.<br>
they both refrence to the same .js file. Here are the pages, and the .js file. I have clipped alot of the text on the pages, but the page is in tact. the pages are part of the frameset. To see the script working, goto: <A HREF=" TARGET="_new"><br>
<br>
.js file:<br>
-------------------------------------------------<br>
var lastLyr;<br>
var time;<br>
net=(document.layers)?1:0;<br>
hidden =(net)?'hide':'hidden';<br>
visible =(net)?'show':'visible';<br>
pre = (net)?'document.layers.':'document.all.';<br>
suf = (net)?'':'.style';<br>
<br>
function changeImg(img,newSrc){<br>
alert(img+' '+newSrc)<br>
theImg =eva('document.'+img);<br>
theImg.src = newSrc;}<br>
<br>
function changeLyr(div){<br>
theDiv = eval(pre+div+suf);<br>
lastLyr.visibility = hidden;<br>
theDiv.visibility = visible;<br>
lastLyr = theDiv;}<br>
<br>
function moveLyrUp(){<br>
lastLyr.top = parseInt(lastLyr.top) - 5;<br>
time = setTimeout('moveLyrUp()',50);}<br>
<br>
function moveLyrDown(){alert('down')<br>
lastLyr.top = parseInt(lastLyr.top) + 5;<br>
time = setTimeout('moveLyrDown()',50);<br>
alert('edown')}<br>
<br>
function cancelLyrMove(){clearTimeout(time);}<br>
<br>
-------------------------------------------------------<br>
<br>
page A:<br>
<br>
---------------------------------------------------------<br>
<br>
<html><br>
<head><br>
<title>If you can see this, goto: robacarp.webjump.com</title><br>
<br>
<script language="javascript" src="scripts/framesetScripts.js"></script><br>
<script language="javascript"><br>
function startIt(){lastLyr = eval(pre+'newUser'+suf);}<br>
</script><br>
<br>
<br>
<style><br>
a{text-decoration:none; color:#C0C0C0}<br>
a:active{text-decoration:none; color#C0C0C0}<br>
a:visited{text-decoration:none; color#C0C0C0}<br>
a:hover{text-decoration:underline; color:#A9B7DC}<br>
.pages {left:10; width:300;}<br>
#container {width:310; height:400; position:absolute; top:10; left:330; border:solid 2px black; overflow:hidden;}<br>
#scroller {position:absolute; top:50; left:305; backgruond-color:#FFFFFF; layer-background-color:#FFFFFF; border:#000000;}<br>
</style></head><br>
<br>
<br>
<body onload="startIt();"><br>
<br>
<!--this is where the page content normally goes--><br>
<br>
<div id="scroller"><!--this is the page scroller--><br>
<!--the up arrow--><br>
<a href="#" onMouseOver="changeImg('thearwup','images/darkArrowUp.gif'); cancelLyrMove(); moveLyrDown();" onMouseOut="changeImg('thearwup','images/lightArrowUp.gif');cancelLyrMove()"><br>
<img src="images/lightArrowUp.gif" name=thearwup border=0></a><br><br>
<br>
<!--the top text--><br>
<br>
<a href="#" onClick="lastLyr.top = 0; return false;">top</a><br><br>
<br>
<!--the down arrow--><br>
<br>
<a href="#" onClick="return false;" onMouseOver="changeImg('thearwdown','images/darkArrowDown.gif'); cancelLyrMove(); moveLyrUp();" onMouseOut="changeImg('thearwdown','images/lightArrowDown.gif');cancelLyrMove();"><br>
<img src="images/lightArrowDown.gif" name=thearwdown border=0></a><br>
</div><br>
<br>
<!--the end of the scroller--><br>
<br>
<br>
<!--this is the container layer--><br>
<div id=container><br>
<br>
<div id=news class=pages style="visibility:hidden; position:absolute; top:0;"><br>
<br>
<!--this is the news page--><br>
<br>
</div><br>
<br>
<div id="newUser" class=pages style="visibility:visible; position:absolute; top:0;"><br>
<br>
<!--this is the newUser page--><br>
<br>
</div><br>
<div align=left id=thanksTo class=pages style="visibility:hidden; position:absolute; top:0;"><br>
<br>
<!--this is the thanksTo div--><br>
<!--in here goes the name/url of he/she whome helps me--><br>
<br>
</div><br>
</div><br>
<!--the end of the container layer--><br>
</body><br>
</html><br>
<br>
---------------------------------------------------<br>
<br>
page B<br>
<br>
---------------------------------------------------<br>
<br>
<html><br>
<head><br>
<title>If you can see this, goto: robacarp.webjump.com</title><br>
<br>
<br>
<script language="javascript" src="scripts/framesetScripts.js"></script><br>
<script language="javascript"><br>
function startIt(){<br>
lastLyr = eval(pre+'theMenu'+suf);}<br>
</script><br>
<br>
<br>
<style><br>
#menu{position:absolute; top:150 width:90%; z-index:3;}<br>
#scrollers{position:absolute; top:0; left:0; z-index:4; width:10%; background-color:#ffffff; layer-background-color:#ffffff;}<br>
a{text-decoration:none; color:#C0C0C0}<br>
a:active{text-decoration:none; color#C0C0C0}<br>
a:visited{text-decoration:none; color#C0C0C0}<br>
a:hover{text-decoration:underline; color:#A9B7DC}<br>
</style></head><br>
<br>
<br>
<body onload=startIt()><br>
<br>
<!--there is no container layer, since this is the only scrollable layer on the page, and it is in frames--><br>
<br>
<div id=theMenu><!--this is where the scrollable page is--></div><br>
<br>
<!--this is the page scroller--><br>
<br>
<div id="scroller"><br>
<br>
<!--the up arrow--><br>
<a href="#" onMouseOver="changeImg('thearwup','images/darkArrowUp.gif'); cancelLyrMove(); moveLyrDown();" onMouseOut="changeImg('thearwup','images/lightArrowUp.gif');cancelLyrMove()"><br>
<img src="images/lightArrowUp.gif" name=thearwup border=0></a><br><br>
<br>
<!--the top text--><br>
<br>
<a href="#" onClick="lastLyr.top = 0; return false;">top</a><br><br>
<br>
<!--the down arrow--><br>
<br>
<a href="#" onClick="return false;" onMouseOver="changeImg('thearwdown','images/darkArrowDown.gif'); cancelLyrMove(); moveLyrUp();" onMouseOut="changeImg('thearwdown','images/lightArrowDown.gif');cancelLyrMove();"><br>
<img src="images/lightArrowDown.gif" name=thearwdown border=0></a><br>
</div><br>
<!--the end of the scroller --><br>
<?html><br>
</body><br>
</html><br>
<br>
Thanks alot.<br>
theEclipse<br>
robacarp.webjump.com<br>
<br>
<br>
P.S.:I not so much want to know how to fix it, but why, otherwise I can't remember not to do it again!!<br>
<br>
but anything is helpfull
<br>
<br>
<br>
<br>
<br>
<br>
Here's the deal:<br>
<br>
I have scripts that I will post at my website for people to use on their site. kind of a library type of thing. I have written the scripts, and they work fine. I also personally use the scripts on my pages (makes sense). and here is the problem. The script works fine on page A, but not page B.<br>
they both refrence to the same .js file. Here are the pages, and the .js file. I have clipped alot of the text on the pages, but the page is in tact. the pages are part of the frameset. To see the script working, goto: <A HREF=" TARGET="_new"><br>
<br>
.js file:<br>
-------------------------------------------------<br>
var lastLyr;<br>
var time;<br>
net=(document.layers)?1:0;<br>
hidden =(net)?'hide':'hidden';<br>
visible =(net)?'show':'visible';<br>
pre = (net)?'document.layers.':'document.all.';<br>
suf = (net)?'':'.style';<br>
<br>
function changeImg(img,newSrc){<br>
alert(img+' '+newSrc)<br>
theImg =eva('document.'+img);<br>
theImg.src = newSrc;}<br>
<br>
function changeLyr(div){<br>
theDiv = eval(pre+div+suf);<br>
lastLyr.visibility = hidden;<br>
theDiv.visibility = visible;<br>
lastLyr = theDiv;}<br>
<br>
function moveLyrUp(){<br>
lastLyr.top = parseInt(lastLyr.top) - 5;<br>
time = setTimeout('moveLyrUp()',50);}<br>
<br>
function moveLyrDown(){alert('down')<br>
lastLyr.top = parseInt(lastLyr.top) + 5;<br>
time = setTimeout('moveLyrDown()',50);<br>
alert('edown')}<br>
<br>
function cancelLyrMove(){clearTimeout(time);}<br>
<br>
-------------------------------------------------------<br>
<br>
page A:<br>
<br>
---------------------------------------------------------<br>
<br>
<html><br>
<head><br>
<title>If you can see this, goto: robacarp.webjump.com</title><br>
<br>
<script language="javascript" src="scripts/framesetScripts.js"></script><br>
<script language="javascript"><br>
function startIt(){lastLyr = eval(pre+'newUser'+suf);}<br>
</script><br>
<br>
<br>
<style><br>
a{text-decoration:none; color:#C0C0C0}<br>
a:active{text-decoration:none; color#C0C0C0}<br>
a:visited{text-decoration:none; color#C0C0C0}<br>
a:hover{text-decoration:underline; color:#A9B7DC}<br>
.pages {left:10; width:300;}<br>
#container {width:310; height:400; position:absolute; top:10; left:330; border:solid 2px black; overflow:hidden;}<br>
#scroller {position:absolute; top:50; left:305; backgruond-color:#FFFFFF; layer-background-color:#FFFFFF; border:#000000;}<br>
</style></head><br>
<br>
<br>
<body onload="startIt();"><br>
<br>
<!--this is where the page content normally goes--><br>
<br>
<div id="scroller"><!--this is the page scroller--><br>
<!--the up arrow--><br>
<a href="#" onMouseOver="changeImg('thearwup','images/darkArrowUp.gif'); cancelLyrMove(); moveLyrDown();" onMouseOut="changeImg('thearwup','images/lightArrowUp.gif');cancelLyrMove()"><br>
<img src="images/lightArrowUp.gif" name=thearwup border=0></a><br><br>
<br>
<!--the top text--><br>
<br>
<a href="#" onClick="lastLyr.top = 0; return false;">top</a><br><br>
<br>
<!--the down arrow--><br>
<br>
<a href="#" onClick="return false;" onMouseOver="changeImg('thearwdown','images/darkArrowDown.gif'); cancelLyrMove(); moveLyrUp();" onMouseOut="changeImg('thearwdown','images/lightArrowDown.gif');cancelLyrMove();"><br>
<img src="images/lightArrowDown.gif" name=thearwdown border=0></a><br>
</div><br>
<br>
<!--the end of the scroller--><br>
<br>
<br>
<!--this is the container layer--><br>
<div id=container><br>
<br>
<div id=news class=pages style="visibility:hidden; position:absolute; top:0;"><br>
<br>
<!--this is the news page--><br>
<br>
</div><br>
<br>
<div id="newUser" class=pages style="visibility:visible; position:absolute; top:0;"><br>
<br>
<!--this is the newUser page--><br>
<br>
</div><br>
<div align=left id=thanksTo class=pages style="visibility:hidden; position:absolute; top:0;"><br>
<br>
<!--this is the thanksTo div--><br>
<!--in here goes the name/url of he/she whome helps me--><br>
<br>
</div><br>
</div><br>
<!--the end of the container layer--><br>
</body><br>
</html><br>
<br>
---------------------------------------------------<br>
<br>
page B<br>
<br>
---------------------------------------------------<br>
<br>
<html><br>
<head><br>
<title>If you can see this, goto: robacarp.webjump.com</title><br>
<br>
<br>
<script language="javascript" src="scripts/framesetScripts.js"></script><br>
<script language="javascript"><br>
function startIt(){<br>
lastLyr = eval(pre+'theMenu'+suf);}<br>
</script><br>
<br>
<br>
<style><br>
#menu{position:absolute; top:150 width:90%; z-index:3;}<br>
#scrollers{position:absolute; top:0; left:0; z-index:4; width:10%; background-color:#ffffff; layer-background-color:#ffffff;}<br>
a{text-decoration:none; color:#C0C0C0}<br>
a:active{text-decoration:none; color#C0C0C0}<br>
a:visited{text-decoration:none; color#C0C0C0}<br>
a:hover{text-decoration:underline; color:#A9B7DC}<br>
</style></head><br>
<br>
<br>
<body onload=startIt()><br>
<br>
<!--there is no container layer, since this is the only scrollable layer on the page, and it is in frames--><br>
<br>
<div id=theMenu><!--this is where the scrollable page is--></div><br>
<br>
<!--this is the page scroller--><br>
<br>
<div id="scroller"><br>
<br>
<!--the up arrow--><br>
<a href="#" onMouseOver="changeImg('thearwup','images/darkArrowUp.gif'); cancelLyrMove(); moveLyrDown();" onMouseOut="changeImg('thearwup','images/lightArrowUp.gif');cancelLyrMove()"><br>
<img src="images/lightArrowUp.gif" name=thearwup border=0></a><br><br>
<br>
<!--the top text--><br>
<br>
<a href="#" onClick="lastLyr.top = 0; return false;">top</a><br><br>
<br>
<!--the down arrow--><br>
<br>
<a href="#" onClick="return false;" onMouseOver="changeImg('thearwdown','images/darkArrowDown.gif'); cancelLyrMove(); moveLyrUp();" onMouseOut="changeImg('thearwdown','images/lightArrowDown.gif');cancelLyrMove();"><br>
<img src="images/lightArrowDown.gif" name=thearwdown border=0></a><br>
</div><br>
<!--the end of the scroller --><br>
<?html><br>
</body><br>
</html><br>
<br>
Thanks alot.<br>
theEclipse<br>
robacarp.webjump.com<br>
<br>
<br>
P.S.:I not so much want to know how to fix it, but why, otherwise I can't remember not to do it again!!<br>
<br>
but anything is helpfull
<br>
<br>
<br>
<br>
<br>