Oscarliu117 (Talk | contribs) |
Oscarliu117 (Talk | contribs) |
||
Line 129: | Line 129: | ||
</div> | </div> | ||
</div> | </div> | ||
+ | </div> | ||
+ | </div> | ||
− | + | <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> | ||
+ | |||
</html> | </html> | ||
{{NCKU_Tainan/footer}} | {{NCKU_Tainan/footer}} |
Revision as of 03:59, 15 September 2018