Results 1 to 2 of 2

Thread: adding loop pause / delay to Cross Browser marquee II

  1. #1
    Join Date
    Feb 2010
    Posts
    29
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default adding loop pause / delay to Cross Browser marquee II

    1) Script Title:
    Cross Browser marquee II

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamicindex2/cmarquee2.htm
    http://www.dynamicdrive.com/forums/s...ad.php?t=55949

    3) Describe problem:
    Having received fantastic help from vwphillps to get the Cross Browser marquee II working with with multiple scrolls/feeds (and without the extra space) i've been struggling to add a delay / pause between each loop. i.e if you look at my page below there are various different delays on page load.

    http://lotus-architects.com/contact.html

    however i would like each feed to stop at the beginning (at the title), or a few seconds before continuing the loop

    does anyone know if its possible (note i used the script provided by vwphillipss on post #4 of the above thread rather than the original)
    Last edited by mannkumar; 07-19-2010 at 04:57 PM. Reason: typo

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    Code:
    <script  type="text/javascript">
    /*<![CDATA[*/
    function Marquee(o){
     var oop=this,obj=document.getElementById(o.ID),top=0;
     var marquee=obj.getElementsByTagName('DIV')[0];
     this.marqueeheight=marquee.offsetHeight;
     marquee.style.top=-this.marqueeheight+'px';
    
     this.marquee=[marquee];
     while (top<obj.offsetHeight){
      marquee=marquee.cloneNode(true);
      marquee.style.top=top+'px';
      obj.appendChild(marquee);
      this.marquee.push(marquee);
      top+=this.marqueeheight;
     }
    
     this.Speed=o.marqueespeed;
     this.hold=o.hold||30;
     var oop=this;
     setTimeout(function(){ oop.scroll(true); }, o.delayb4scroll)
    }
    
    Marquee.prototype.scroll=function(srt){
     var oop=this,ms=30;
     for (var top,z0=0;z0<this.marquee.length;z0++){
      top=parseInt(this.marquee[z0].style.top)-this.Speed;
      this.marquee[z0].style.top=top+"px";
      if (top<-this.marqueeheight){
       this.marquee[z0].style.top=top+this.marqueeheight*this.marquee.length+"px";
       if (!srt){
        ms=this.hold;
       }
      }
     }
     setTimeout(function(){ oop.scroll(); },ms);
    }
    
    /*]]>*/
    </script>
    <script type="text/javascript">
    /*<![CDATA[*/
    var M1=new Marquee({
     ID:'marqueecont',
     delayb4scroll:9900, //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
     hold:2000,
     marqueespeed:1 //Specify marquee scroll speed (larger is faster 1-10)
    });
    
    var M2=new Marquee({
     ID:'marqueecont2',
     delayb4scroll:3900, //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
     hold:2000,
     marqueespeed:1 //Specify marquee scroll speed (larger is faster 1-10)
    });
    
    var M3=new Marquee({
     ID:'marqueecont3',
     delayb4scroll:1900, //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
     hold:2000,
     marqueespeed:1 //Specify marquee scroll speed (larger is faster 1-10)
    });
    
    var M4=new Marquee({
     ID:'marqueecont4',
     delayb4scroll:5900, //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
     hold:2000,
     marqueespeed:1 //Specify marquee scroll speed (larger is faster 1-10)
    });
    
    var M5=new Marquee({
     ID:'marqueecont5',
     delayb4scroll:7900, //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
     hold:2000,
     marqueespeed:1 //Specify marquee scroll speed (larger is faster 1-10)
    });
    
    var M6=new Marquee({
     ID:'marqueecont6',
     delayb4scroll:2900, //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
     hold:2000,
     marqueespeed:1 //Specify marquee scroll speed (larger is faster 1-10)
    });
    
    var M7=new Marquee({
     ID:'marqueecont7',
     delayb4scroll:4900, //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
     hold:2000,
     marqueespeed:1 //Specify marquee scroll speed (larger is faster 1-10)
    });
    
    var M8=new Marquee({
     ID:'marqueecont8',
     delayb4scroll:6900, //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
     hold:2000,
     marqueespeed:1 //Specify marquee scroll speed (larger is faster 1-10)
    });
    
    var M9=new Marquee({
     ID:'marqueecont9',
     delayb4scroll:8900, //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
     hold:2000,
     marqueespeed:1 //Specify marquee scroll speed (larger is faster 1-10)
    });
    
    
    
    
    
    
    /*]]>*/
    </script>
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. The Following User Says Thank You to vwphillips For This Useful Post:

    mannkumar (07-20-2010)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •