Advertisement
GIFCITY

waving text

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