home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Archived / Internet / jvscript116beta / JvScript / !JvScript / Resources / Scripts / Scrollers / 4 < prev    next >
Encoding:
Text File  |  1999-08-24  |  1.2 KB  |  59 lines

  1. #newformat
  2. _title:One-Letter
  3. _description: Adds one letter at a time to the status bar.
  4.  
  5. #_caption:Message
  6. _message:Scrolling Message
  7.  
  8. _insert-in: head
  9. <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
  10. <!-- Begin
  11. function scroll(jumpSpaces,position) {
  12. var msg = "¤message_object$(1)¤"
  13. var out = ""
  14. if (killScroll) {return false} 
  15. for (var i=0; i<position; i++){
  16. out += msg.charAt(i)}
  17. for (i=1;i<jumpSpaces;i++) {
  18. out += " "}
  19. out += msg.charAt(position)
  20. window.status = out
  21. if (jumpSpaces <= 1) {
  22. position++
  23. if (msg.charAt(position) == ' ') {
  24. position++ }
  25. jumpSpaces = 100-position        
  26. }
  27. else if (jumpSpaces >  3) {
  28. jumpSpaces *= .75}
  29. else {
  30. jumpSpaces--}
  31. if (position != msg.length) {
  32. var cmd = "scroll(" + jumpSpaces + "," + position + ")";
  33. scrollID = window.setTimeout(cmd,5);
  34. else {
  35. scrolling = false
  36. return false}
  37. return true;
  38. }
  39. function startScroller() {
  40. if (scrolling)
  41. if (!confirm('Re-initialize snapIn?'))
  42. return false
  43. killScroll = true
  44. scrolling = true
  45. var killID = window.setTimeout('killScroll=false',6)
  46. scrollID = window.setTimeout('scroll(100,0)',10)
  47. return true
  48. }
  49. var scrollID = Object
  50. var scrolling = false
  51. var killScroll = false
  52. // End -->
  53. </SCRIPT>
  54. _end-insert:
  55.  
  56. _insert-in:inbodytag
  57. onLoad="startScroller()"
  58. _end-insert: