Difference between revisions of "Template:Freiburg/MenubarTest"
(Created page with "<!--doctype html--> <html> <head> <title>""</title> <meta charset="utf-8"> <style> /* ============= BEGIN: Stylesheet for navigation menu ===========...") |
|||
Line 387: | Line 387: | ||
$(function() { | $(function() { | ||
$("document").ready(function(){ | $("document").ready(function(){ | ||
+ | |||
+ | |||
+ | $(window).scroll(function (event) { | ||
+ | // var top = $('#menubar').offset().top - parseFloat($('#menubar').css('marginTop').replace(/auto/, 100)); | ||
+ | var y = $(this).scrollTop(); | ||
+ | // console.log(y); | ||
+ | |||
+ | |||
+ | |||
+ | if(y>61){ | ||
+ | |||
+ | $('#navtextwrapper').css('display', 'block'); | ||
+ | $('#navtextwrapper').css('z-index', '9999'); | ||
+ | $('#navtextwrapper').css('width', '100%'); | ||
+ | $('#navtextwrapper').css('background', '#0051A2'); | ||
+ | $('#navtextwrapper').css('height', '30'); | ||
+ | |||
+ | $('#navtextwrapper').css('top', y); | ||
+ | |||
+ | |||
+ | |||
+ | $('#navicons ul li').css('z-index', '10000'); | ||
+ | $('#navicons ul li').css('top', y-60); | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | } else{ | ||
+ | $('#navtextwrapper').css('display', 'none'); | ||
+ | $('#navtextwrapper').css('top', 80); | ||
+ | $('#navtextwrapper').css('width', '100%'); | ||
+ | $('#navtextwrapper').css('background', '#0051A2'); | ||
+ | $('#navtextwrapper').css('position', 'absolute'); | ||
+ | |||
+ | $('#navicons ul li').css('top', 0); | ||
+ | |||
+ | } | ||
+ | |||
+ | }); | ||
+ | |||
+ | |||
+ | |||
+ | |||
// make submenus appear // | // make submenus appear // | ||
$("#home").hover(function(){ | $("#home").hover(function(){ |
Revision as of 15:46, 8 September 2015