Results 1 to 2 of 2

Thread: Mulitlpe Scripts?

  1. #1
    Join Date
    Aug 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Mulitlpe Scripts?

    1) Script Title: Memory Ticker

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...moryticker.htm

    3) Describe problem:

    Hello, I am trying to get 2 tickers on 1 webpage. Can you please tell me if this can be done? I have tried various ways, and got the second one to work, but would not change text. If anyone has managed to get this to work, I would be very greatful of a script where I can adjust. I would like to still be able to change the font size and obviously different text as well.

    Thanks in advanced.

    Paul D

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

    Default

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <title></title>
    <style type="text/css">
    
    #memoryticker{
    background-color: lightyellow;
    width: 450px;
    font: bold 12px Verdana;
    /*Tip: add in height attribute here for multiple line scroller*/
    border: 1px solid black;
    padding: 3px;
    /*Change 0.7 below to a different number if desired (0.7=0.7 seconds)*/
    /*Remove below line to remove transitional effect in IE. Below line should always appear last within this CSS*/
    filter: progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)
    }
    
    #memoryticker1{
    background-color: lightyellow;
    width: 450px;
    font: bold 12px Verdana;
    /*Tip: add in height attribute here for multiple line scroller*/
    border: 1px solid black;
    padding: 3px;
    /*Change 0.7 below to a different number if desired (0.7=0.7 seconds)*/
    /*Remove below line to remove transitional effect in IE. Below line should always appear last within this CSS*/
    filter: progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)
    }
    
    </style></head>
    
    <body>
    <div id="memoryticker" ></div>
    <div id="memoryticker1" ></div>
    
    <script  type="text/javascript">
    /*<![CDATA[*/
    
    function Ticker(o){
     this.obj=document.getElementById(o.ID);
     this.nme=o.ID;
     this.ms=o.tickdelay||3000;
     this.ary=o.tickercontents;
     this.cnt=0;
     this.cng();
    }
    
    Ticker.prototype={
    
     cng:function(){
      if (this.obj.filters && this.obj.filters.length>0){
       this.obj.filters[0].Apply()
      }
      this.obj.innerHTML=this.ary[this.cnt]
      if (this.obj.filters && this.obj.filters.length>0){
      this.obj.filters[0].Play()
      }
      this.cnt=(this.cnt==this.ary.length-1)? this.cnt=0 : this.cnt+1
      var filterduration=(this.obj.filters&&this.obj.filters.length>0)? this.obj.filters[0].duration*1000 : 0
      var oop=this;
      setTimeout(function(){ oop.cng(); },this.ms+filterduration)
     }
    }
    
    
    new Ticker({
    ID:'memoryticker',
     tickercontents:[
    '1) <a href="http://www.javascriptkit.com">JavaScriptKit.com</a>- JavaScript tutorials and scripts.</a>',
    '2) <a href="http://www.codingforums.com">Coding Forums</a>- Web coding and development forums.</a>',
    '3) <a href="http://www.dynamicdrive.com">DynamicDrive.com</a>- Award winning, original DHTML scripts.</a>',
    '4) <a href="http://www.freewarejava.com">FreewareJava</a>- Free Java applets, tutorials, and resources.</a>'
    ],
    tickdelay:2000,
    persistdays:1
    });
    
    new Ticker({
    ID:'memoryticker1',
     tickercontents:[
    '1) <a href="http://www.javascriptkit.com">JavaScriptKit.com</a>- JavaScript tutorials and scripts.</a>',
    '2) <a href="http://www.codingforums.com">Coding Forums</a>- Web coding and development forums.</a>',
    '3) <a href="http://www.dynamicdrive.com">DynamicDrive.com</a>- Award winning, original DHTML scripts.</a>',
    '4) <a href="http://www.freewarejava.com">FreewareJava</a>- Free Java applets, tutorials, and resources.</a>'
    ],
    tickdelay:3000,
    persistdays:1
    });
    /*]]>*/
    </script>
    
    </body>
    
    </html>
    I can add persistance if required
    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/

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
  •