stop window.setinterval javascript
const pause = (scroll) => window.clearTimeout(scroll)
const scrollAuto = () => {
const elem = document.getElementById('id');
const scroll = window.setInterval(() => {
if (elem.scrollTop > 1200) {
pause(scroll)
}
else {
elem.scrollTop = elem.scrollHeight;
}
}, 500);
}; window.clearTimeout(yourTimer)
Also in JavaScript:
- conditional props react
- sweet alert 2 do action on confirm
- how to change the font family using jquery
- JavaScript chop/slice/trim off last character in string
- javascript regex example match
- c# convert object to json
- javascript check object methods
- javascript add multiple items to array
- plyr for react js
- how to get the value of textarea in react
- javascript find directory root
- create new object from existing object javascript
- remove required attribute jquery mvc
- javascript match
- jquery get data attribute
- rest api with mongodb and nodejs
- discord.js v12 how to set owner commands
- useeffect with cleanup
- change page title js
- sharing data using service angular 6
- capacitor doc
- javascript recorrer json
- telerik asp.net ajax error creating control
- get actual url in variable