Difference between revisions of "Template:AUC TURKEY"
Line 47: | Line 47: | ||
.fixedMenu { | .fixedMenu { | ||
position:fixed; | position:fixed; | ||
− | top: | + | top:6px; |
z-index:999; | z-index:999; | ||
+ | } | ||
+ | .shiftContent { | ||
+ | top:100px; | ||
} | } | ||
</style> | </style> | ||
Line 54: | Line 57: | ||
// Calling the function | // Calling the function | ||
$(function(){ | $(function(){ | ||
− | |||
− | |||
// get the top offset of the menu element var | // get the top offset of the menu element var | ||
− | menuTop = $( | + | menuTop = $("#menu").offset().top; |
// trigger the function when the windows scroll | // trigger the function when the windows scroll | ||
$(window).scroll(function() { | $(window).scroll(function() { | ||
Line 67: | Line 68: | ||
if (htmlTop > menuTop) { | if (htmlTop > menuTop) { | ||
// add the class to stick on top | // add the class to stick on top | ||
− | $( | + | $("#menu").addClass(".fixedMenu"); |
+ | $("#contentContainer").addClass(".shiftContent"); | ||
} else { | } else { | ||
// remove the stick on top class | // remove the stick on top class | ||
− | $( | + | $("#menu").removeClass(".fixedMenu"); |
+ | $("#contentContainer").removeClass(".shiftContent"); | ||
} | } | ||
− | + | }}); | |
− | + | ||
</script> | </script> | ||
<div class="menu"> | <div class="menu"> |
Revision as of 11:42, 23 June 2015