jQuery
【jQuery】スクロールダウンするとback to topを表示するjQuery back to top
October 1, 2018

jQuery back to topはページをスクロールダウンするときに「トップに戻る」タグを表示するjQueryプラグイン。
<header><h1>Back to top demo</h1></header> <div id="random-txt"> </div> <section> </section> <!-- end of content --> <footer> by <a href="http://twitter.com/#!/shichuan">@shichuan</a> </footer> <div id="back-to-top"></div> <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="../jquery.backtotop.js"></script> <script> for (var i = 0; i < 100; i+=1 ) { $('#random-txt').append('<p>Test</p>'); } $('#back-to-top').backtotop(); </script>