前端切圖:一句代碼實現返回頂部

5640239-8e5fcb0cc3d8dfaf.png
圖片發自簡書App

首先引入js文件javascript

<script type="text/javascript" src="http://hovertree.com/ziyuan/jquery/jquery-1.11.3.min.js";></script>
  <script type="text/javascript" src="http://hovertree.com/texiao/yestop/inc/jquery.yestop.js";></script>

一句重要代碼實現html

<script type="text/javascript">
    $(document).ready(function () { $.fn.yestop(); })
  </script>

demo以下前端

<!DOCTYPE html>
<html>
<head><meta charset="UTF-8">
  <title>YesTop - HoverTree</title><meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script type="text/javascript" src="http://hovertree.com/ziyuan/jquery/jquery-1.11.3.min.js";></script>
  <script type="text/javascript" src="http://hovertree.com/texiao/yestop/inc/jquery.yestop.js";></script>
  <style>
    body {
      margin: 0px;font-family:Arial
    }a{color:blue}
  </style>
</head>
<body>
  <div style="text-align:center;width:100%;margin:0px auto;">
    <h1>我是否是前端妹子啊???</h1>
   你是妹子??<br />
  
  </div>
  <div style="height: 1000px;background-color: blanchedalmond;">
   
  </div>
 
  <script type="text/javascript">
    $(document).ready(function () { $.fn.yestop(); })
  </script>
</body>
</html>

OK了,一句代碼寫完,不用在寫不少東西咯
仿知乎返回頂部java

相關文章
相關標籤/搜索