Results 1 to 5 of 5

Thread: Typing Scroller with links

  1. #1
    Join Date
    Dec 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Typing Scroller with links

    Hi, I'm trying to use this scroller on my website:
    http://www.dynamicdrive.com/dynamici...typescroll.htm

    I want to turn the lines that wre displayed into links so people can click on them. It will be a news headline ticker.

    Can anyone suggest how I might do this? Or where I can get one from. I am trying to produce something similar to the one at http://news.bbc.co.uk/

    Many thanks

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Try this out, put this in the head of your page:

    Code:
    <style type="text/css">
    
    #banner { /*Set style for scroller*/
    text-decoration:none;
    font-family:verdana, arial, sans-serif;
    font-size:12px;
    font-weight:bold;
    color:blue;
    }
    
    #banner:hover { /*Set color for mouseover scroller*/
    color:lightblue;
    }
    
    </style>
    and this script where you want the typing scroller to appear:

    Code:
    <script type="text/javascript">
    
    /*Typing Scroller
      Submitted by bengaliboy00@hotmail.com (hp: http://www.angelfire.com/nt/bengaliboy/)
      With modifications by Dynamicdrive.com
      Additional modifications by jscheuer1 29/Dec/2005
      as seen in http://dynamicdrive.com/forums
      For full source code, usage terms, and 100s more scripts, visit http://dynamicdrive.com
      */
    
    //Set pause between messages in milliseconds, use 3000 for default:
    var pause=3000
    
    //Set typing speed (higher numbers are slower, use 60 for default)
    var speed=60
    
    //Secify scroller contents, links
    var line=new Array()
    line[1]=["This is an awsome script", "http://www.google.com/"]
    line[2]=["It brings up the text you want...", "http://www.dynamicdrive.com/"]
    line[3]=["One letter at a time", "javascript:void(0)"] //no link syntax
    line[4]=["You can add and subtract lines as you like.", "http://www.yahoo.com/"]
    line[5]=["It\'s very cool and easy to use", "http://www.codingforums.com/"]
    
    ///////////////Stop Editing////////////
    
    if (document.all||document.getElementById){
    document.write('<a id="banner" href="'+line[1][1]+'" onmousedown="window.location=this.href;return false;" onclick="return false;"></a>')
    }
    
    var lines=line.length-1,
    temp="",
    ban=document.getElementById? document.getElementById('banner') : document.all.banner,
    nextchar=-1,
    nextline=1,
    cursor=" ";
    function animate(){
    if (ban.href.indexOf(line[nextline][1])==-1)
    ban.href=line[nextline][1]
    ban.style.cursor=/void/.test(ban)? 'text': ''
    if (temp==line[nextline][0] & temp.length==line[nextline][0].length & nextline!=lines){
    nextline++;
    nextchar=-1;
    ban.innerHTML=temp;
    temp="";
    setTimeout("nextstep()", pause)
    }
    else if (nextline==lines & temp==line[nextline][0] & temp.length==line[nextline][0].length){
    nextline=1;
    nextchar=-1;
    ban.innerHTML=temp;
    temp="";
    setTimeout("nextstep()", pause)
    }
    else
    nextstep()
    }
    
    function nextstep(){
    cursor=cursor=="_"? " " : "_"
    nextchar++;
    temp+=line[nextline][0].charAt(nextchar);
    ban.innerHTML=temp+cursor
    setTimeout("animate()", speed)
    }
    
    if (document.all||document.getElementById)
    onload=animate;
    
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Sep 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Does anyone know if the 'Typing Scroller with links' script can be used on the same page as the 'Fading Ticker Tape' script' ?

    I have added both scripts to the following page but only the typing scroller seems to work:

    http://www.westendfc.netfirms.com/scroller.htm

    I've read some of the posts about conflicting scripts and I have removed the 'onload=animate' function from the typing scroller and added this into the body onload tag and although both scripts now work - the fading ticker script goes ''crazy'':

    http://www.westendfc.netfirms.com/scroller2.htm

    Any ideas?

    Regards,

    Darren

  4. #4
    Join Date
    Feb 2006
    Location
    Georgia-USA
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

  5. #5
    Join Date
    Feb 2006
    Location
    Georgia-USA
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Is there any way to use this script as an external js file so it can be used on more than one page but only require editing in the external file?

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
  •