Advertisement
dianakko

newsticker pink

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