home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Archived / Internet / jvscript116beta / JvScript / !JvScript / Resources / Scripts / Scrollers / 2 < prev    next >
Encoding:
Text File  |  1999-09-15  |  1.4 KB  |  51 lines

  1. #newformat
  2. _title:Editor
  3. _description:Allows you to manipulate the speed and message to perfect your own scrolly thing.
  4.  
  5. _caption:Initial Message
  6.  
  7. _insert-in:inhead
  8. <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
  9. <!-- Begin
  10. var id,pause=0,position=0;
  11. function banner() {
  12. var i,k,msg=document.form1.message.value;
  13. k=(66/msg.length)+1;
  14. for(i=0;i<=k;i++) msg+=" "+msg;    document.form2.banner.value=msg.substring(position,position+50);
  15. if(position++==document.form1.message.value.length) 
  16. position=0;    
  17. id=setTimeout("banner()",1000/document.form1.speed.value);
  18. }
  19. function action() {    
  20. if(!pause) {        
  21. clearTimeout(id);        
  22. pause=1; 
  23. }    
  24. else {
  25. banner();        
  26. pause=0; 
  27.    }
  28. }
  29. // End -->
  30. </SCRIPT>
  31. _end-insert:
  32.  
  33. _insert-in:inbody
  34. <FORM name="form1">
  35. <TABLE border="3">
  36. <caption>Edit box</caption>
  37. <tr><td align="right">Message:</td>
  38. <td><input type="text" name="message" value="¤caption_object$(1)¤                                              " size="50"></td></tr>
  39. <tr><td align="right">Speed:</td>
  40. <td><input type="text" name="speed" value="10" size="5"></td></tr>
  41. <tr><td align="right">Change:</td>
  42. <td><center><input type="button" value=" Click here to make changes take effect" onclick="clearTimeout(id);position=0;banner()"></center></td></tr>
  43. </TABLE>
  44. </FORM>
  45. <FORM name="form2">
  46. <input type="text" name="banner" size="50"><br>
  47. <input type="hidden" value=" Start Banner " onclick="action()">
  48. </FORM>
  49. </CENTER>
  50.  
  51. _end-insert: