Alex: Javascript mehrmals gleichzeitig aufrufen

Beitrag lesen

So, mein Problem hat (außer Griever) scheinbar niemanden so wirklich interessiert ;)

Vielleicht ist die Lösung ja interessantener:

---

txt=new Array();
lnk=new Array();
globalid=new Array();

function startel(id,text,link) {

newid = globalid.push(id);
 txt.push(text);
 lnk.push(link);

if (globalid.length == 1){

pos=1;
   tmr=null;
     schreibel();
    }
}

function schreibel() {
  if(!tmr) tmr= window.setInterval("schreibel()", 50);

teilText = txt[0].substr(0,pos);
  document.getElementById(globalid[0]).innerHTML="<a target='_blank' href='" +lnk[0]+ "'>" +teilText+ "</a>";

if (pos >= txt[0].length) {

lnk.shift();
    txt.shift();
    globalid.shift();

window.clearInterval(tmr);

if (globalid.length > 0){

pos=1;
   tmr=null;

schreibel();
    }

}
  pos++;
}

---

Aufruf im HTML mit:

---

<span style="cursor:pointer; cursor:hand;" onClick="
 startel(1,'Flickr,','http://flickr.com/photos/a74Ri');
 startel(2,'Delicious,','http://del.icio.us/Atari82');
 startel(3,'Myspace','http://www.myspace.com/atary');
 ">goto "web" ,8,1 </span>

<span id="1" class="Switch"></span>
 <span id="2" class="Switch"></span>
 <span id="3" class="Switch"></span>

---

… und alles ganz alleine gelöst :) obwohl ich heute Morgen noch nicht mal wusste, was nen Array ist.

LevelUP=new Array(1,5,10,50,100);
AlexLevel=AlexLevel+LevelUP[3];

Gruß, Alex