Difference between revisions of "Template:Hong Kong-CUHK"

(Undo revision 79097 by Sammisylo (talk))
Line 11: Line 11:
 
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
 
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
  
 +
<!-- Functionallity and behaviour JS -->
 +
  <script>
 +
 +
    $(document).ready(function(){
 +
 +
      //Loading screen functionallity
 +
      $('.loading').animate(
 +
          {opacity:0},
 +
          500,
 +
          function(){
 +
            $('.loading').attr("style", "display:none");
 +
          }
 +
      );
 +
 +
      //Height responsiveness
 +
      $(window).resize(function() {
 +
          wheight = $(window).height();
 +
          $('.container').attr("style","height:"+(wheight)+"px;background-size:cover;");
 +
          $('.team-member-container').attr("style","height:"+wheight/2.7+"px;");
 +
      });
 +
 +
      $(window).trigger('resize');
 +
 +
      //Menu moveto container on item click functionallity
 +
      $('.menu-item').on('click', function(){
 +
          $('.menu-item').removeClass('subselected');
 +
          $(this).addClass('subselected');
 +
          if($(this).attr("data")=="#top"){
 +
              $('html, body').animate({
 +
                  scrollTop: 0
 +
              }, 1000);
 +
          }else{
 +
              $('html, body').animate({
 +
                  scrollTop: $($(this).attr("data")).offset().top-70
 +
              }, 1000);
 +
          }
 +
      });
 +
   
 +
  </script>
 
   <style>
 
   <style>
  

Revision as of 16:59, 7 August 2017