Difference between revisions of "Template:HSNU-TAIPEI/nav js"

(Created page with "<html> <script> var menu = $("#main-menu"), showLeft = $(".showLeft"), menuButton = $(".menu-button"), secondLayerList = $(".seclayer"); function toggleMenu() { me...")
 
Line 1: Line 1:
 
<html>
 
<html>
 +
 
<script>
 
<script>
var menu = $("#main-menu"),
+
$(document).ready(function() {
    showLeft = $(".showLeft"),
+
var layerOpen = false;
    menuButton = $(".menu-button"),
+
$(".next-layer").click(function() {
    secondLayerList = $(".seclayer");
+
$( this ).siblings( "li" ).each(function() {
 
+
$( this ).children( ".sub-layer" ).hide();
function toggleMenu() {
+
});
  menu.toggleClass("slide-menu-open");
+
$( this ).children( ".sub-layer" ).toggle();
  menuButton.toggle();
+
layerOpen = !layerOpen;
}
+
});
 
+
});
showLeft.click(toggleMenu);
+
 
+
secondLayerList.hover(
+
  function() {
+
    $(this).children('.seclayer-nav').fadeIn('fast');
+
  }, function() {
+
    $(this).children('.seclayer-nav').fadeOut('fast');
+
  }
+
);
+
 
+
  
 
</script>
 
</script>
 
</html>
 
</html>

Revision as of 15:44, 28 May 2015