Lauftext als Java Script Mehrmals auf einer Seite abspielen funktioniert nicht

pcpaul

Mitglied
Hallo,

ich habe ein ein Java Script eingebunden auf meine HTML seite.


Java:
tNews=new Array();
//<![CDATA[
tNews.push('<a href="images/slider/images/tour1_1.jpg" rel="lytebox" title="Rothenburg Tour 1 Foto 1" To><img src="images/slider/thumbs/tour1_1.jpg" /></a>');

tNews.push('<a href="images/slider/images/tour1_2.jpg" rel="lytebox" title="Rothenburg Tour 2 Foto 1"><img src="images/slider/thumbs/tour1_2.jpg" /></a>');

tNews.push('<a href="images/slider/images/tour1_3.jpg" rel="lytebox" title="Rothenburg Tour 3 Foto 1"><img src="images/slider/thumbs/tour1_3.jpg" /></a>');

tNews.push('<a href="images/slider/images/tour1_4.jpg" rel="lytebox" title="Rothenburg Tour 4 Foto 1"><img src="images/slider/thumbs/tour1_4.jpg" /></a>');

tNews.push('<a href="images/slider/images/tour1_5.jpg" rel="lytebox" title="Rothenburg Tour 5 Foto 1"><img src="images/slider/thumbs/tour1_5.jpg" /></a>');

//]]>



//∞∞∞∞∞∞∞∞∞∞Delimiter zwischen den einzelnen News
tDelimiter  =' ';

//∞∞∞∞∞∞∞∞∞∞Interval in ms
tInterval   =20;

//∞∞∞∞∞∞∞∞∞∞Stop bei mouseover?true:false
tStop       =true;

//∞∞∞∞∞∞∞∞∞∞Falls Leeraum zwischen News...hier Wert erhoehen...minimum:1
tRepeat     =2;

//∞∞∞∞∞∞∞∞∞∞Rahmen
tBorder     ='0px';

//∞∞∞∞∞∞∞∞∞∞Breite
tWidth      =780;

//∞∞∞∞∞∞∞∞∞∞Hˆhe
tHeight     =200;

//Abstand Rahmen->Inhalt (top+bottom)
tPadding    =10;




/* * * * * * * * * * * * * *         D E R  T I C K E R       * * * * * * * * * * * * * * * * * * */
/* * * * * * * * * * * * * * ab hier bitte nichts mehr ‰ndern * * * * * * * * * * * * * * * * * * */

IE  = document.all&&!window.opera;
DOM = document.getElementById&&!IE;

if(DOM||IE)
    {
    var tGo,
        tPos  = 0,
        tStop = tStop?'onmouseover="clearInterval(tGo)"'+ 'onmouseout="tGo=setInterval(\'DM_ticken()\','+tInterval+')"':'',
        tTxt  = tDelimiter+tNews.join(tDelimiter),
        tNews = tTxt;
       
        for(i = 1; i < tRepeat; ++i)
          {
            tNews+=tTxt;
          }
         
        document.write('<div style="overflow:hidden;border:' + tBorder +
                       ';width:' + tWidth + 'px;height:' + tHeight + 'px;' +
                       'padding:' + tPadding + 'px 0px ' + tPadding + ' px 0px;">' +
                       '<div style="position:absolute;width:' + tWidth + 'px;height:' + tHeight + 'px;'+
                       'overflow:hidden;clip:rect(0px '+tWidth+'px '+tHeight+'px 0px)">'+
                       '<span id="ticker"style="white-space:nowrap;position:relative;"' + tStop + '>' + tNews +
                       '</span></div></div>');
       
        tObj = IE ? document.all.ticker : document.getElementById('ticker');
   
    function DM_ticken()
      {
        tOffset = tObj.offsetWidth/tRepeat;
        if(Math.abs(tPos) > tOffset)
          {
            tPos=0;
          }
        tObj.style.left=tPos+'px';
        tPos=parseInt(tPos)-1;
      }
   
    tGo=setInterval('DM_ticken()',tInterval);
    }


diesen binde ihr hier auf meine HTML seite ein:

HTML:
            <div id="slider_tour1">
            <script type="text/javascript" src="images/slider/slider_rothenburg.js"></script> </div>




Mein Problem jetzt,

wenn ich den Mehrmals auf eine HTML seite einbinden will (mehrere Lauftexte, dann funktioniert es nicht mehr)

könnte mir jmd helfen?

Danke
 

Zurück
Oben