I would like to exclude this JavaScript from functioning at a screen size smaller than 768px.
Do you know what I need to add to the code?
<script type="text/javascript">
var timeOut;
function scrollToTop() {
if (document.body.scrollTop!=0 || document.documentElement.scrollTop!=0){
window.scrollBy(0,-50);
timeOut=setTimeout('scrollToTop()',10);
}
else{
clearTimeout(timeOut);
}
}
</script>