Oscarliu117 (Talk | contribs) |
Oscarliu117 (Talk | contribs) |
||
Line 258: | Line 258: | ||
</style> | </style> | ||
+ | |||
+ | <script> | ||
+ | $(document).ready(function () { | ||
+ | $(window).scroll(function () { | ||
+ | if ($(this).scrollTop() >= 90) { | ||
+ | var position = $("#sidelist").position(); | ||
+ | if (position == undefined) {} else { | ||
+ | $('#sidelist').css({ | ||
+ | "position": "fixed", | ||
+ | "top": "145px", | ||
+ | "margin-top": "0px" | ||
+ | }); | ||
+ | } | ||
+ | } else { | ||
+ | $('#sidelist').removeAttr('style'); | ||
+ | } | ||
+ | }); | ||
+ | $(function () { | ||
+ | $('i.fa-arrow-up').click(function () { | ||
+ | $('html, body').animate({ | ||
+ | scrollTop: 0 | ||
+ | }, 600); | ||
+ | return false; | ||
+ | }); | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
</body> | </body> |
Revision as of 04:41, 19 September 2018