1$(document).ready(function (){
2 $('.scrollup').click(function(){
3 if (navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/)) {
4 window.scrollTo(0,0);
5 }
6 else{
7 $('html,body').animate({
8 scrollTop: 0
9 }, 500, function(){
10 $('html,body').clearQueue();
11 });
12 }
13 });
14});
15
16<div class="scrollup">
17 <svg height="35" viewBox="0 0 512 512" width="30">
18 <polygon points="396.6,352 416,331.3 256,160 96,331.3 115.3,352 256,201.5 "/>
19 </svg>
20</div>