Returntop:function(){ //predefined returns the HTML code at the top, and its CSS style defaults to not showing vargototop_html = ' <div class= ' returntop ' ></div> '; //inserts the HTML code that is returned at the top of the page at the end of the element with the ID page $(". Ding_c_returntop"). Append (gototop_html); varWindowtop=0;//distance from the top of the page for the initial session viewable area$ (document). Scroll (function() { varScrolls = $ ( This). ScrollTop ();//gets the distance from the top of the page for the current viewable area if(Scrolls>=windowtop) {//when B>a, indicates that the page is sliding up //actions to be performedwindowtop=Scrolls; $(". Ding_c_returntop"). Hide (); Console.log (On) }Else{//when B<a represents a gesture swipe down //actions to be performedConsole.log ("Down") Windowtop=Scrolls; $(". Ding_c_returntop"). Show (); } }); $(". Ding_c_returntop"). Show (); $(". Ding_c_returntop"). Click (//defines the animation that returns the top click scrolling up function() {$ (' html,body '). Animate ({scrolltop:0},700); }); },
JQ move back to top, slide down to show back button, hide Back button when swipe up