Template:Team:DTU-Denmark/css3

From 2014.igem.org

(Difference between revisions)
 
(13 intermediate revisions not shown)
Line 170: Line 170:
.header{
.header{
background-color:#2c8d26; /* #2c8d26 Green #353535 old black*/
background-color:#2c8d26; /* #2c8d26 Green #353535 old black*/
-
position:absolute;
+
position:fixed;
height:135px;
height:135px;
top:0px;
top:0px;
Line 210: Line 210:
color: #FFF;
color: #FFF;
background-color:none;
background-color:none;
-
margin: 0 20px 0 0;
+
margin: 0 10px 0 0;
float: left;
float: left;
position: relative;
position: relative;
Line 224: Line 224:
font-weight:700;
font-weight:700;
line-height:210%;
line-height:210%;
-
color: #FF0000;
+
color: none;
text-decoration: none;
text-decoration: none;
                 position: relative;
                 position: relative;
Line 241: Line 241:
/*border-top:solid 1px #ffff00;*/
/*border-top:solid 1px #ffff00;*/
/*border-bottom:solid 1px #ffff00;*/
/*border-bottom:solid 1px #ffff00;*/
-
padding: 5px 5px 5px 5px;
+
padding: 7px 5px 3px 5px;
Line 476: Line 476:
background-size: 100%;
background-size: 100%;
}
}
-
}
 
-
#ScrollMenu.fixed {
 
-
    position: fixed;
 
-
    top: 0;
 
-
    left: 0;
 
-
    z-index: 1;
 
-
    width: 100%;
 
-
    border-bottom: 5px solid #ffffff;
 
}
}
</style>
</style>
-
<script>
 
-
$(document).ready(function () { 
 
-
  var top = $('#ScrollMenu').offset().top - parseFloat($('#ScrollMenu').css('marginTop').replace(/auto/, 100));
 
-
  $(window).scroll(function (event) {
 
-
    // what the y position of the scroll is
 
-
    var y = $(this).scrollTop();
 
-
    // whether that's below the form
 
-
    if (y >= top) {
 
-
      // if so, ad the fixed class
 
-
      $('#ScrollMenu').addClass('fixed');
 
-
    } else {
 
-
      // otherwise remove it
 
-
      $('#ScrollMenu').removeClass('fixed');
 
-
    }
 
-
  });
 
-
});
 
-
</script>
 
</html>
</html>

Latest revision as of 09:53, 29 July 2014