Line 22: | Line 22: | ||
<body> | <body> | ||
<!--banner--> | <!--banner--> | ||
− | <div class="container row fixedBackground"> | + | <section> |
− | + | <div class="container row fixedBackground"> | |
− | + | <div class="fixedBackgroundImg" | |
− | + | style="background-image: url(https://static.igem.org/mediawiki/2021/f/fd/T--XJTU-China--bg.jpg);"></div> | |
− | < | + | </div> |
− | + | </section> | |
− | <!-- | + | <!--main--> |
<section class="main"> | <section class="main"> | ||
<div class="container mainBox" id="mainBox"> | <div class="container mainBox" id="mainBox"> | ||
Line 201: | Line 201: | ||
</div> | </div> | ||
</section> | </section> | ||
− | |||
<!--JS--> | <!--JS--> | ||
Line 212: | Line 211: | ||
<!-- <script type="text/javascript" | <!-- <script type="text/javascript" | ||
src="https://2021.igem.org/wiki/index.php?title=Template:XJTU-China/ytmenu&action=raw&ctype=text/javascript"></script> --> | src="https://2021.igem.org/wiki/index.php?title=Template:XJTU-China/ytmenu&action=raw&ctype=text/javascript"></script> --> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<!--to-top btn--> | <!--to-top btn--> | ||
<script> | <script> | ||
− | $(document).ready(function () { | + | var ftoTopBtn = (function () { |
− | + | $(document).ready(function () { | |
− | + | $("#to-top").hide(); | |
− | + | $(function () { | |
− | + | $(window).scroll(function () { | |
− | + | if ($(window).scrollTop() > 600) { | |
− | + | $("#to-top").fadeIn(500); | |
− | + | } else { | |
− | + | $("#to-top").fadeOut(500); | |
− | + | } | |
− | + | }); | |
− | + | $("#to-top").click(function () { | |
− | + | $('body,html').animate({ | |
− | + | scrollTop: 0 | |
− | + | }, 500); | |
+ | return false; | ||
+ | }); | ||
}); | }); | ||
}); | }); | ||
− | }) | + | |
+ | })() | ||
</script> | </script> | ||
− | |||
<!--dr-menuSliding--> | <!--dr-menuSliding--> | ||
<script> | <script> | ||
− | window.addEventListener('scroll', function () { | + | var fsliding = (function () { |
− | + | window.addEventListener('scroll', function () { | |
− | + | var scroll = $(window).scrollTop(); | |
− | + | var pageHeight = $(window).height(); | |
− | + | var pageWidth = $(window).width(); | |
− | + | var drMenu = $(".dr-menu"); | |
− | + | var containerHeight = $("#container").height(); | |
− | + | var drMenuHeight = drMenu.height(); | |
− | + | var headerHeight = $("header").height(); | |
− | + | if (pageWidth < 992) { | |
− | + | drMenu.hide(); | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
else { | else { | ||
− | drMenu. | + | drMenu.show(); |
− | "position": "relative", | + | // drmenu到底, -5px莫名其妙 |
− | + | if (scroll - 5 - (0.7 * pageHeight - headerHeight) + drMenuHeight >= containerHeight) { | |
− | " | + | drMenu.css({ |
− | + | "position": "relative", | |
+ | "top": (containerHeight - drMenuHeight).toString() + "px" | ||
+ | }); | ||
+ | } | ||
+ | //滑动时,-5px莫名其妙 | ||
+ | else if (scroll - 5 > 0.7 * pageHeight - headerHeight) { | ||
+ | drMenu.css({ | ||
+ | "position": "fixed", | ||
+ | "top": (headerHeight + 100).toString() + "px" | ||
+ | }); | ||
+ | } | ||
+ | //未滑动时 | ||
+ | else { | ||
+ | drMenu.css({ | ||
+ | "position": "relative", | ||
+ | "top": "0" | ||
+ | }); | ||
+ | } | ||
} | } | ||
− | } | + | }) |
− | }) | + | })() |
</script> | </script> | ||
</body> | </body> |
Revision as of 07:46, 10 July 2021
hin./ious
PART1 This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up. To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left s To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon,
PART2 To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up. To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up. To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon,
PART3 the main menu appears beneath and the menu icon slides to the right side while the label slides up. To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up. the main menu appears beneath and the menu icon slides to the right side while the label slides up. To close the menu, the menu icon needs t To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up. To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon,
PART4 the main menu appears beneath and the menu icon slides to the right side while the label slides up.o be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up. To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up. To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up. the main menu appears beneath and the menu icon slides to the right side while the label slides up. To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up.ide menu found on YouTube. When clicking on the menu label and icon, To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up.
PART5 To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up. the main menu appears beneath and the menu icon slides to the right side while the label slides up. To close the menu, the menu icon needs t To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up. To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up.o be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and t To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up. To close the menu, the menu icon needs to be clicked again. This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up.he menu icon slides to the right side while the label slides up. To close the menu, the menu icon needs to be clicked again. >This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up. To close the menu, the menu icon needs to be clicked again. his menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up. To close the menu, the menu icon needs to be clicked again.This menu is inspired by the left side menu found on YouTube. When clicking on the menu label and icon, the main menu appears beneath and the menu icon slides to the right side while the label slides up. To close the menu, the menu icon needs to be clicked again.