Advertisement
dnwmfilms

↳ ❝ [news ticker text] ¡! ❞

Nov 6th, 2021
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. <style>
  2. #news {
  3. text-shadow: -1px 0 #000, 0 1px #000, 1px 0 #000, 0 -1px #000, 0 0;
  4. font-size:200%;
  5. font-weight:bold;
  6. color: #fff;
  7. }
  8. </style>
  9. <head>
  10. <script type="text/javascript">
  11. // <![CDATA[
  12. var news=Array("This is the NEWS-TICKER TEXT EFFECT", "Brought to you by the good people at www.mf2fm.com/rv", "Did you note how the web-address was turned into a hyperlink?", "Another free effect "+String.fromCharCode(169)+"2004 onwards RV's free DHTML effects", "Check back from time to time to get the latest scripts...");
  13. var cursor="_"; // set cursor
  14. var delay=12; // seconds between each news item
  15.  
  16. /***************************\
  17. * News Ticker Text Effect *
  18. *(c)2004-14 mf2fm web-design*
  19. * http://www.mf2fm.com/rv *
  20. * DON'T EDIT BELOW THIS BOX *
  21. \***************************/
  22. var newsp, cursp, flash, item=0;
  23.  
  24. if (typeof('addRVLoadEvent')!='function') function addRVLoadEvent(funky) {
  25. var oldonload=window.onload;
  26. if (typeof(oldonload)!='function') window.onload=funky;
  27. else window.onload=function() {
  28. if (oldonload) oldonload();
  29. funky();
  30. }
  31. }
  32.  
  33. addRVLoadEvent(teleprint);
  34.  
  35. function teleprint () { if (document.getElementById) {
  36. var span=document.getElementById("news");
  37. while (span.childNodes.length) span.removeChild(span.childNodes[0]);
  38. delay*=1000;
  39. newsp=document.createElement("span");
  40. cursp=document.createElement("span");
  41. cursp.appendChild(document.createTextNode(String.fromCharCode(160)+cursor));
  42. span.appendChild(newsp);
  43. span.appendChild(cursp);
  44. ticker();
  45. }}
  46.  
  47. function ticker() {
  48. var i;
  49. while (newsp.childNodes.length) newsp.removeChild(newsp.childNodes[0]);
  50. newsp.appendChild(document.createTextNode(news[item].substring(0,1)));
  51. for (i=1; i<news[item].length; i++) setTimeout('newsp.firstChild.nodeValue="'+news[item].substring(0, i+1)+'"', 100*i);
  52. if (news[item].indexOf("www")!=-1) setTimeout('linkit('+item+')', 100*i);
  53. setTimeout('flash=setInterval("cursp.style.visibility=(cursp.style.visibility==\'visible\')?\'hidden\':\'visible\'", 234)', 100*i)
  54. setTimeout('clearInterval(flash)', delay);
  55. setTimeout('cursp.style.visibility="visible"', delay);
  56. setTimeout('ticker()', delay);
  57. item=++item%news.length;
  58. }
  59.  
  60. function linkit(q) {
  61. var a,p,e,l;
  62. p=news[q].indexOf("www");
  63. e=news[q].indexOf(" ", p);
  64. if (e==-1) e=news[q].length;
  65. l=news[q].substring(p, e);
  66. while (newsp.childNodes.length) newsp.removeChild(newsp.childNodes[0]);
  67. newsp.appendChild(document.createTextNode(news[q].substring(0, p)));
  68. a=document.createElement("a");
  69. a.href="http://"+l;
  70. a.appendChild(document.createTextNode(l));
  71. newsp.appendChild(a);
  72. newsp.appendChild(document.createTextNode(news[q].substring(e)));
  73. }
  74. // ]]>
  75. </script>
  76. </head>
  77. <span id="news">NEWS-TICKER</span>
  78.  
  79.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement