Answers for "jquery scroll up not working on android"

0

jquery scroll up not working on android

$(document).ready(function (){  
  $('.scrollup').click(function(){
    if (navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/)) {           
      window.scrollTo(0,0);
    }
    else{
      $('html,body').animate({
        scrollTop: 0
        }, 500, function(){
        $('html,body').clearQueue();
      });
    }
  });              
});

<div class="scrollup">
    <svg height="35" viewBox="0 0 512 512" width="30">
        <polygon points="396.6,352 416,331.3 256,160 96,331.3 115.3,352 256,201.5 "/>
    </svg>
</div>
Posted by: Guest on September-21-2021

Code answers related to "jquery scroll up not working on android"

Code answers related to "Javascript"

Browse Popular Code Answers by Language