ad.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //双击滚屏
  2. var currentpos, timer;
  3. function initialize(){
  4. timer = setInterval("scrollwindow()", 50);
  5. }
  6. function sc(){
  7. clearInterval(timer);
  8. }
  9. function scrollwindow(){
  10. currentpos = document.body.scrollTop;
  11. window.scroll(0, ++currentpos);
  12. if (currentpos != document.body.scrollTop)
  13. sc();
  14. }
  15. document.onmousedown = sc
  16. document.ondblclick = initialize
  17. var dsize=12;
  18. function reduce()
  19. {
  20. dsize--;
  21. txt.style.cssText='{font-size:'+dsize+'pt;}';
  22. txt.style.color=txtcolor.options[txtcolor.selectedIndex].value;
  23. txt.style.fontFamily=ziti.options[ziti.selectedIndex].value
  24. parent.FontSize=dsize;
  25. }
  26. function enlarge()
  27. {
  28. dsize++;
  29. txt.style.cssText='{font-size:'+dsize+'pt;}';
  30. txt.style.color=txtcolor.options[txtcolor.selectedIndex].value;
  31. txt.style.fontFamily=ziti.options[ziti.selectedIndex].value
  32. parent.FontSize=dsize;
  33. }
  34. function loadchapter()
  35. {
  36. bcolor.selectedIndex = parent.bcolor1;
  37. txtcolor.selectedIndex = parent.txtcolor1;
  38. ziti.selectedIndex=parent.ziti1;
  39. bkk.style.background=bcolor.options[bcolor.selectedIndex].value;
  40. txt.style.color=txtcolor.options[txtcolor.selectedIndex].value;
  41. txt.style.fontFamily=ziti.options[ziti.selectedIndex].value
  42. if(parent.FontSize!=null)
  43. {
  44. var pat=/[0-9]+/gi;
  45. if(pat.exec(parent.FontSize))
  46. {
  47. dsize=parent.FontSize;
  48. txt.style.cssText='{font-size:'+dsize+'pt;}';
  49. txt.style.color=txtcolor.options[txtcolor.selectedIndex].value;
  50. txt.style.fontFamily=ziti.options[ziti.selectedIndex].value
  51. }
  52. }
  53. }