Advertisement
Guest User

Marquee with wobbling text

a guest
Aug 27th, 2023
561
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. <script type="text/javascript">
  2. // <![CDATA[
  3. var speed=100; // speed of wobbling, lower is faster
  4. var height=3; // height of wobbling in pixels
  5. var alink="http://www.mf2fm.com/rv"; // page to link text to (set to ="" for no link)
  6.  
  7. /****************************
  8. * Wobbly Text Effect *
  9. *(c) 2003-6 mf2fm web-design*
  10. * http://www.mf2fm.com/rv *
  11. * DON'T EDIT BELOW THIS BOX *
  12. ****************************/
  13. var wobtxt, wobble, wobcnt=0;
  14. window.onload=function() { if (document.getElementById) {
  15. var i, wobli;
  16. wobble=document.getElementById("wobble");
  17. wobtxt=wobble.firstChild.nodeValue;
  18. while (wobble.childNodes.length) wobble.removeChild(wobble.childNodes[0]);
  19. for (i=0; i<wobtxt.length; i++) {
  20. wobli=document.createElement("span");
  21. wobli.setAttribute("id", "wobb"+i);
  22. wobli.style.position="relative";
  23. wobli.appendChild(document.createTextNode(wobtxt.charAt(i)));
  24. if (alink) {
  25. wobli.style.cursor="pointer";
  26. wobli.onclick=function() { top.location.href=alink; }
  27. }
  28. wobble.appendChild(wobli);
  29. }
  30. setInterval("wobbler()", speed);
  31. }}
  32.  
  33. function wobbler() {
  34. for (var i=0; i<wobtxt.length; i++) document.getElementById("wobb"+i).style.top=Math.round(height*Math.sin(i+wobcnt))+"px"
  35. wobcnt++;
  36. }
  37. // ]]>
  38. </script>
  39. <style>
  40. /*you can change this as much as youd like. howdy from ian @ codes.crd*/
  41. marquee {
  42.  
  43. }
  44. #wobble {
  45.  
  46. }
  47. </style>
  48.  
  49. <marquee>check out this <span id="wobble">WOBBLY TEXT</span></marquee>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement