BigRob
2010-12-15, 20:05:04
Hi,
könnte mir evtl. jemand einen tipp geben, warum die schleife nicht funktioniert? Sie wird wohl nur einmal durchlaufen.
var c_width = 10;
var c_max = 30;
function slide()
{
while(c_width < c_max)
{
takt = setTimeout("slide_in()",1000);
}}
function slide_in()
{
var counter = document.getElementById("counter").style;
if(c_width < c_max)
{c_width+=5;}
else {c_width = c_max;}
counter.width = c_width;
}
Außerdem:
warum geht das nicht:
var c_width = document.getElementById("counter").offsetWidth;
Schon mal danke!
könnte mir evtl. jemand einen tipp geben, warum die schleife nicht funktioniert? Sie wird wohl nur einmal durchlaufen.
var c_width = 10;
var c_max = 30;
function slide()
{
while(c_width < c_max)
{
takt = setTimeout("slide_in()",1000);
}}
function slide_in()
{
var counter = document.getElementById("counter").style;
if(c_width < c_max)
{c_width+=5;}
else {c_width = c_max;}
counter.width = c_width;
}
Außerdem:
warum geht das nicht:
var c_width = document.getElementById("counter").offsetWidth;
Schon mal danke!