DIV tag fixed postioning not working
Hey there,
I'm having trouble with some div tag position for a menu I'm working on. It was working correctly but then decided to not work.
The menu is meant to sit at the bottom of the screen and then when scrolled past, sit at the top.
Here's the reduced code.
CSS code
[CODE]
body {
margin-left:0px;
margin-top:0px;
margin-right:0px;
margin-bottom:0px;
width:100%;
}
.contents{
margin-top:2px;
font-family:Tahoma, Geneva, sans-serif;
font-size:14px;
}
.menuHolder{
float:left;
}
.menuWrapper{
float:left;
height:60px;
width:100%;
padding-top:0px;
background-color:#000;
text-align:center;
margin-left: auto;
margin-right: auto;
bottom:0px;
}
.menuContents {
background-color:#000;
color:#FFF;
padding-top:0px;
left: 0px;
height:60px;
width:100%;
margin-left: auto;
margin-right: auto;
}
.menuBtns{
border:none;
display: block;
margin-left: auto;
margin-right: auto;
}
.menuContents.sticky {
position: fixed;
top: 0px;
box-shadow:0pt 1px rgb(0, 0, 0) inset, 0pt 1px 3px rgba(34, 25, 25, 0.4);
}
.menuHolder {
background-color:#000;
}
[ICODE]
And the page;
php/html
[CODE]
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>giroygente.org</title>
<link href="stylegiroygente.css" rel="stylesheet" type="text/css" />
<!-- java script conetents-->
<script type="text/javascript">
google.load("jquery", "1");
function sticky_relocate() {
var window_top = $(window).scrollTop();
var div_top = $('#menuStick').offset().top;
if (window_top > div_top)
$('.menuContents').addClass('sticky')
else
$('.menuContents').removeClass('sticky');
}
google.setOnLoadCallback(function() {
$(window).scroll(sticky_relocate);
sticky_relocate();
});
</script>
</head>
<body>
<!-- start of contentsHollder div-->
<!-- start of menu div-->
<div class="contentHolder">
<div class="logo"><a name="Giro Y Gente" href="index.php"><img name="Giro Y Gente" src="images/logo.png" width="295" height="94" alt="Giro Y Gente" /></a></div>
<div class="menuHolder">
<div class="colageFlash"><img src="images/backeg.jpg" width="1278" height="692" alt="Giro Y Gente" /></div>
<!-- end of flash div -->
<div class="menuWrapper">
<div id="menuStick"></div>
<div class="menuContents">
<div class="menuBtns"></div></div>
</div>
<!-- end of menu div -->
</div>
</div>
<!-- end of contentsHolder div -->
</body>
</html>
[ICODE]
Any help would be hugely appreciated. THANKS.
|