Difference between revisions of "Template:INSA-UPS France/script scroll"

Line 3: Line 3:
 
<script type="text/javascript">
 
<script type="text/javascript">
  
$(document).ready(function(){
+
  $(document).ready(function(){
                alert("Hello");
+
    $("#HQ_page").attr('id','');
$("#HQ_page").attr('id','');
+
  });
});
+
 
+
    function isScrolledIntoView(elem)
function isScrolledIntoView(elem)
+
 
     {
 
     {
 
         var docViewTop = $(window).scrollTop();
 
         var docViewTop = $(window).scrollTop();
Line 20: Line 19:
  
 
     $(document).ready(function(){
 
     $(document).ready(function(){
 +
      //$(".backToTop").hide(0);
 
       if (window.innerWidth>600){
 
       if (window.innerWidth>600){
 
         $(window).scroll(function(){
 
         $(window).scroll(function(){
 +
          /*$('body').addClass('header-fixed');*/
 
           if ($(this).scrollTop() > 500) {
 
           if ($(this).scrollTop() > 500) {
 
               $('body').addClass('header-fixed');
 
               $('body').addClass('header-fixed');
 +
              //$(".backToTop").show(500);
 
               if ($(this).scrollTop() > 580){
 
               if ($(this).scrollTop() > 580){
 
                 $('#vertical_nav').addClass('can_move');
 
                 $('#vertical_nav').addClass('can_move');
Line 32: Line 34:
 
           } else {
 
           } else {
 
               $('body').removeClass('header-fixed');
 
               $('body').removeClass('header-fixed');
 +
              //$(".backToTop").hide(500);
 
           }
 
           }
 +
          /*if (isScrolledIntoView('footer')){
 +
            $(".backToTop").hide(500);
 +
          }*/
 
         });
 
         });
 
       }
 
       }
Line 81: Line 87:
 
});
 
});
  
</script>
+
  </script>
 
+
  </html>
 
+
</html>
+

Revision as of 12:42, 2 June 2017