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!

help with this annoying error...

Status
Not open for further replies.

mackey333

Technical User
May 10, 2001
563
US
ok..here is my code:

Code:
<script language=&quot;javascript&quot;>

function loadDivs1() {    

    distance = 0

    for (i=0; i<83; i++) {
    
        distance++
    
        document.write(&quot;<div align=\&quot;center\&quot; id=\&quot;1divMover&quot; + i + &quot;style=\&quot;position: absolute; top: &quot; + distance + &quot;%\&quot;/>&quot;);

Code:
        document.getElementById('1divMover' + i).style.visibility ='hidden';

Code:
        document.write(&quot;<img border=\&quot;0\&quot; src=\&quot;tapdance.gif\&quot; width=\&quot;30\&quot; height=\&quot;69\&quot;/>&quot;);    
        document.write(&quot;</div/>&quot;);
    
    }
    
    document.write(&quot;</td/>&quot;);
    document.write(&quot;</tr/>&quot;);
    document.write(&quot;</table/>&quot;);
    document.write(&quot;</div/>&quot;);

}

function loadDivsSetup() {

    document.write(&quot;<div align=\&quot;center\&quot; id=\&quot;parentDiv\&quot; style=\&quot;position: relative; background-color: #FFFFFF;  height: 100%; width: 100%\&quot;/>&quot;);    
    document.write(&quot;<table align=\&quot;center\&quot; border=\&quot;0\&quot; cellspacing=\&quot;0\&quot; cellpadding=\&quot;0\&quot; width=\&quot;100%\&quot; height=\&quot;100%\&quot;/>&quot;);
    document.write(&quot;<tr/>&quot;);
    document.write(&quot;<td/>&quot;);
    
    loadDivs1();
}    
    

var num, countHide, countShow

num = 83
countHide = 1
countShow = 2

function startLoopSet() {

Code:
    document.getElementById('1divMover' + countHide).style.visibility ='hidden';
    document.getElementById('1divMover' + countShow).style.visibility = 'visible';

Code:
    countHide++
    countShow++
    
    if (countShow != num) {
    
        setTimeout('startLoopSet()', 1)
    }
}
    
loadDivs1();    
    


</script>

</head>

<body bgColor=&quot;FF0000&quot; onLoad=&quot;startLoopSet()&quot;>
    
</body>

I'm getting an object required error on the bold lines..is it not calling the same div that was created?

thanks for any help...
-Greg :-Q
 
oops..the functions are not called in the right order..but I am still getting the same errors, here is the new code:

Code:
<script language=&quot;javascript&quot;>

var num, countHide, countShow

num = 83
countHide = 1
countShow = 2

function loadDivsSetup() {

	document.write(&quot;<div align=\&quot;center\&quot; id=\&quot;parentDiv\&quot; style=\&quot;position: relative; background-color: #FFFFFF;  height: 100%; width: 100%\&quot;/>&quot;);	
	document.write(&quot;<table align=\&quot;center\&quot; border=\&quot;0\&quot; cellspacing=\&quot;0\&quot; cellpadding=\&quot;0\&quot; width=\&quot;100%\&quot; height=\&quot;100%\&quot;/>&quot;);
	document.write(&quot;<tr/>&quot;);
	document.write(&quot;<td/>&quot;);
	
	loadDivs1();
}	

function loadDivs1() {	

	distance = 0

	for (i=0; i<83; i++) {
	
		distance++
	
		document.write(&quot;<div align=\&quot;center\&quot; id=\&quot;1divMover&quot; + i + &quot;style= \&quot;position: absolute; top: &quot; + distance + &quot;%\&quot;/>&quot;);		
		
		document.getElementById('1divMover' + i).style.visibility ='hidden';

		document.write(&quot;<img border=\&quot;0\&quot; src=\&quot;tapdance.gif\&quot; width=\&quot;30\&quot; height=\&quot;69\&quot;/>&quot;);    
		document.write(&quot;</div/>&quot;);
	}
	
	document.write(&quot;</td/>&quot;);
	document.write(&quot;</tr/>&quot;);
	document.write(&quot;</table/>&quot;);
	document.write(&quot;</div/>&quot;);

}

function startLoopSet() {

	document.getElementById('1divMover' + countHide).style.visibility = 'hidden';
	document.getElementById('1divMover' + countShow).style.visibility = 'visible';
	
	countHide++
	countShow++
	
	if (countShow != num) {
	
		setTimeout('startLoopSet()', 1)
	}
}

loadDivsSetup();	
	


</script>

</head>

<body bgColor=&quot;FF0000&quot; onLoad=&quot;startLoopSet()&quot;>
	

	
</body>

</html>
-Greg :-Q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top