biao2.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. var speed = 5;
  2. var currentpos=1;
  3. var timer;
  4. function img_zoom(e, o) //ͼƬÊó±ê¹öÂÖËõ·Å
  5. {
  6. var zoom = parseInt(o.style.zoom, 10) || 100;
  7. zoom += event.wheelDelta / 12;
  8. if (zoom > 0) o.style.zoom = zoom + '%';
  9. return false;
  10. }
  11. function setSpeed()
  12. {
  13. speed = parseInt(scrollspeed.value);
  14. if (speed < 1 || speed > 10){
  15. speed=5;
  16. scrollspeed.value=5;
  17. }
  18. }
  19. function stopScroll()
  20. {
  21. clearInterval(timer);
  22. }
  23. function beginScroll()
  24. {
  25. timer=setInterval("scrolling()",250/speed);
  26. }
  27. function scrolling()
  28. {
  29. //currentpos=document.documentElement.scrollTop;
  30. currentpos=document.body.scrollTop;
  31. window.scroll(0,++currentpos);
  32. //if(currentpos!=document.documentElement.scrollTop) clearInterval(timer);
  33. if(currentpos!=document.body.scrollTop) clearInterval(timer);
  34. }
  35. function saveSet()
  36. {
  37. parent.txtcolor1=txtcolor.selectedIndex;
  38. parent.fontsize1=fontsize.selectedIndex;
  39. parent.scrollspeed1=scrollspeed.value;
  40. }
  41. function loadSet()
  42. {
  43. txtcolor.selectedIndex=parent.txtcolor1;
  44. fontsize.selectedIndex=parent.fontsize1;
  45. if(parent.scrollspeed1!=undefined)
  46. scrollspeed.value=parent.scrollspeed1;
  47. else scrollspeed.value=5;
  48. setSpeed();
  49. //document.bgColor=bgcolor.options[bgcolor.selectedIndex].value;
  50. document.fgColor=txtcolor.options[txtcolor.selectedIndex].value;
  51. document.all.content.style.fontSize=fontsize.options[fontsize.selectedIndex].value;
  52. }
  53. document.onmousedown=stopScroll;
  54. document.ondblclick=beginScroll;
  55. loadSet();