Here is the site inaction:
http://sunfrieddesign.com/toggle.html
And here is the code I'm working with:
<html>
<head>
<script type='text/javascript' src='http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js'></script>
<script type="text/javascript">
//<![CDATA[
$(window).load(function(){
$('.toggle').click(function(){
if($("#header").css("top") == "360px") {
$("#header").animate({top: "0px"}, 1000);
} else {
$("#header").animate({top: "360px"}, 1000);
}
return false;
});
});//]]>
</script>
<style type="text/css">
body {background: #fff;}
#header {
position: fixed; /*I would like this div to always be fixed to the top of the browser window*/
top: 0px;
left: 0;
width: 100%;
height: 355px;
z-index: 10;
background: #ccc;
}
</style>
</head>
<body>
<div id="header">
<img src="slash2.png" width="100%" style="margin-top:-440px;">
<br>
<a href="#header" class="toggle">
<p> </p>
Click me to reveal the top half of this div</a>
<p> </p><p> </p><p> </p><p> </p>
</div>
</body>
oh wow, duh.. just answered my own question:
I needed to make the width 1700px or any number, but not 100%.
I still don't know how to get the background to stretch to top when revealing page, though...
and I don't know why those little characters are popping up upon page reveal... I've seen that happen before... don't remember how I fixed it... (sorry for multiple posts)
Aaaand I just solved my own question again.... geez i'm sorry. How do i delete this post? I'm new :\ haha.

New Topic/Question
Reply


MultiQuote







|