Difference between revisions of "Template:Team:TU Darmstadt/Viki"

Line 1,447: Line 1,447:
 
   var isFixed = ($element.css('position') == 'fixed');
 
   var isFixed = ($element.css('position') == 'fixed');
  
   if ($(this).scrollTop() > headerHeight {{&&}} !isFixed) {
+
   if ($(this).scrollTop() > headerHeight) {
    console.log('scroll');
+
    if(!isFixed) {
    $element.addClass("scrolled");
+
        console.log('scroll');
 +
        $element.addClass("scrolled");
 +
    }
 
   }
 
   }
   if ($(this).scrollTop() < headerHeight {{&&}} isFixed) {
+
   if ($(this).scrollTop() < headerHeight) {
    console.log('dont scroll');
+
    if(isFixed) {
    $element.removeClass("scrolled");
+
        console.log('dont scroll');
 +
        $element.removeClass("scrolled");
 +
    }
 
   }
 
   }
 
});
 
});

Revision as of 15:25, 5 October 2016