(query)
| 53 | } |
| 54 | |
| 55 | function handleTextBox(query) { |
| 56 | var textBox = box.querySelector(query); |
| 57 | const text = textBox.dataset.text; // Store the original text |
| 58 | textBox.textContent = ""; // Clear the box for typing effect |
| 59 | let index = 0; |
| 60 | |
| 61 | // Function to type text slowly |
| 62 | function type() { |
| 63 | if (index < text.length) { |
| 64 | textBox.textContent += text.charAt(index); // Append the current character |
| 65 | index++; |
| 66 | setTimeout(type, 50); // Schedule the next character typing |
| 67 | } else { |
| 68 | isTyping = false; // Reset flag when typing is done |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | type(); // Start typing the text |
| 73 | } |
| 74 | for (let i = 0; i <= box.children.length; i++) { |
| 75 | handleTextBox("#expandText"+i.toString()); |
| 76 | } |
no test coverage detected