I'm playing with jQuery, and I want to fade out the logo. So basically, I want to have the animation fade out the logo first and then slowly shrink the header, so I can only see the id="nav" div. I tried using slideToggle, but it seems to just make my header div layer disappear rather than shrinking it to the header collapse.
<div id="header"><div id="nav"></div></div>
#header {
height: 25px;
margin:0;
padding:85px 0 0 5px;
background-image: url("images/logo.png");
background-repeat: no-repeat;
}
#header-collapse {
padding: 5px 0 0 5px;
height: 25px;
margin: 0;
}
<script>
$("#viewmode").click(function(){
$("#viewmode").click(function(){
$("#header").attr("id", "header-collapse");
});
</script>
Update: I am testing this:
$("#header").fadeTo(1000,0).css("background-image", "none");
But this fades the header div which contains the nav div, and I only want to fade the logo. How can I select the headers background-image?
Update: I used this for a link. How can I make click and go back to the original?
<a href="#" id="viewmode">View Mode</a> <br />
<script>
$("#viewmode").click(function(){
$("#logo").fadeTo(1000,0);
$("#logo").animate({'height':'0'},'fast');
});
</script>