Home  >  Article  >  Web Front-end  >  When the left side of jquery floats to a certain position, the return to top button is displayed_jquery

When the left side of jquery floats to a certain position, the return to top button is displayed_jquery

WBOY
WBOYOriginal
2016-05-16 16:46:131124browse
复制代码 代码如下:

<script> <br>$(function(){ <br><br>$(window).bind('scroll',function(){ <br><br>if ($(document).scrollTop() >200) { <br>$(".asd-return").show(1); <br>}else{ <br>$(".asd-return").hide(1); <br>} <br>}) <br>$(".asd-return").click(function(){ <br>$('body,html').animate({scrollTop:0},1000); <br>}) <br>}) <br><br></script>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn