Guest User

Untitled

a guest
May 18th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. setInterval(function () {
  2. for (var i = 1; i <= 7; i++) {
  3. ajaxRequestTomcat(i);
  4. }
  5. }, 3000);
  6.  
  7.  
  8. var scroll = scrollFunc();
  9. function scrollFunc() {
  10. return setInterval(function() {autoScroll()}, 5000);
  11. }
  12. function autoScroll() {
  13. for (var x = 1; x < 8; x++) {
  14. var textarea = document.getElementById("tomcatlog" + x);
  15. textarea.scrollTop = textarea.scrollHeight;
  16. }
  17. }
  18.  
  19. document.getElementById("scroll").addEventListener("click", function() {
  20. currentValue = document.getElementById("scroll").value;
  21. color = document.getElementById("scroll");
  22. if (currentValue == "On") {
  23. color.style.backgroundColor = "#008000";
  24. scroll = scrollFunc();
  25. console.log(scroll)
  26. document.getElementById("scroll").value = "Off";
  27. } else {
  28. color.style.backgroundColor = "#B22222";
  29. console.log(scroll)
  30. clearInterval(scroll);
  31. console.log(scroll)
  32. document.getElementById("scroll").value = "On";
  33. }
  34. });
Add Comment
Please, Sign In to add comment