Difference between revisions of "Template:BNU-CHINA/Javascript/index"

Line 22: Line 22:
  
 
$(document).ready(function() {
 
$(document).ready(function() {
   #('#sideMenu').hide()
+
   $('#sideMenu').hide()
 
})
 
})
  

Revision as of 05:41, 7 October 2016

/**

* Created by lvxin on 16/9/25.
* Co-worked by Zitan Chen (czt95@icloud.com)
*/


/**----------------------------------------------

>>> Table of Contents:
------------------------------------------------
0.0 global
1.0 navigation bar
------------------------------------------------
*/

/**

--  0.0 global
*/

var totalHeight = document.documentElement.clientHeight; $(".page-heading").css(

   "height", totalHeight

);

$(document).ready(function() {

  $('#sideMenu').hide()

})

/**

*  1.0 navigation bar
*/

$(window).scroll(function () {

   if ($(window).scrollTop() >= document.documentElement.clientHeight) {
       $('.nav-container').addClass('scrolled-down');
   }
   if ($(window).scrollTop() < document.documentElement.clientHeight) {
       $('.nav-container').removeClass('scrolled-down');
       $('.nav-container').removeClass('scrolled-top');
   }
   if ($(window).scrollTop() === 0) {
       $('.nav-container').addClass('scrolled-top');
   }

});

console.log($('#sideMenu'))