Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setInterval(function () {
- for (var i = 1; i <= 7; i++) {
- ajaxRequestTomcat(i);
- }
- }, 3000);
- var scroll = scrollFunc();
- function scrollFunc() {
- return setInterval(function() {autoScroll()}, 5000);
- }
- function autoScroll() {
- for (var x = 1; x < 8; x++) {
- var textarea = document.getElementById("tomcatlog" + x);
- textarea.scrollTop = textarea.scrollHeight;
- }
- }
- document.getElementById("scroll").addEventListener("click", function() {
- currentValue = document.getElementById("scroll").value;
- color = document.getElementById("scroll");
- if (currentValue == "On") {
- color.style.backgroundColor = "#008000";
- scroll = scrollFunc();
- console.log(scroll)
- document.getElementById("scroll").value = "Off";
- } else {
- color.style.backgroundColor = "#B22222";
- console.log(scroll)
- clearInterval(scroll);
- console.log(scroll)
- document.getElementById("scroll").value = "On";
- }
- });
Add Comment
Please, Sign In to add comment