Difference between revisions of "Template:AUC TURKEY"
Line 4: | Line 4: | ||
.topWikiNavBackground { | .topWikiNavBackground { | ||
− | + | height:18px; | |
− | + | margin-top: -32px; | |
− | + | background-color:transparent; | |
} | } | ||
Line 44: | Line 44: | ||
padding-left: 20px; | padding-left: 20px; | ||
font-size: 15pt; | font-size: 15pt; | ||
+ | } | ||
+ | .fixedMenu { | ||
+ | position:fixed; | ||
+ | top:0px; | ||
+ | z-index:999; | ||
} | } | ||
</style> | </style> | ||
+ | <script> | ||
+ | // Calling the function | ||
+ | setFixMenu('#menu', 'fixedMenu'); | ||
+ | |||
+ | function setFixMenu(element, stickyCssClass) { | ||
+ | // get the top offset of the menu element var | ||
+ | menuTop = $(element).offset().top; | ||
+ | // trigger the function when the windows scroll | ||
+ | $(window).scroll(function() { | ||
+ | // get total scrolling | ||
+ | var htmlTop = $(window).scrollTop(); | ||
+ | // check if the scrolling is less than top offset of menu | ||
+ | // then stick the menu on top by adding the stickyCssClass | ||
+ | // If not then set the menu at it's default position by removing the stickyCssClass | ||
+ | if (htmlTop > menuTop) { | ||
+ | // add the class to stick on top | ||
+ | $(element).addClass(stickyCssClass); | ||
+ | } else { | ||
+ | // remove the stick on top class | ||
+ | $(element).removeClass(stickyCssClass); | ||
+ | } | ||
+ | }); | ||
+ | } | ||
+ | </script> | ||
<div id="menu"> | <div id="menu"> | ||
</div> | </div> | ||
<div id="contentContainer"> | <div id="contentContainer"> | ||
</html> | </html> |
Revision as of 11:24, 23 June 2015