Difference between revisions of "Team:NCHU Taichung/js/main.js"

Line 3: Line 3:
 
     e.preventDefault();
 
     e.preventDefault();
 
     $('#sidemenu').toggle();
 
     $('#sidemenu').toggle();
 +
    $('body, html').animate({
 +
      scrollTop: 0                      // Scroll to top of body
 +
    }, 500);
 
   });
 
   });
 
   $('.ui.dropdown').dropdown()
 
   $('.ui.dropdown').dropdown()
 
});
 
});

Revision as of 15:41, 4 October 2018

$(document).ready(function () {

 $('#openSidebar').on("click", function (e) {
   e.preventDefault();
   $('#sidemenu').toggle();
   $('body, html').animate({
     scrollTop: 0                       // Scroll to top of body
   }, 500);
 });
 $('.ui.dropdown').dropdown()

});