i'm new to JQuery + CSS so be patient please. I'm making a website that just have a header with a logo and i need it to be just like a button.. It has to change the background (an image) of the upper div when click it. But, when i click on it, the background change like it should but the logo disappears..
My problem should be simple but i can't see the solution anywhere... I'm using this:
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/reset.css" type="text/css" media="all">
<link rel="stylesheet" href="css/layout.css" type="text/css" media="all">
<link rel="stylesheet" href="css/style.css" type="text/css" media="all">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="js/atooltip.jquery.js"></script>
<script type="text/javascript" src="js/kwicks-1.5.1.pack.js"></script>
<script type="text/javascript" src="js/script.js"></script>
</head>
<body id="page1">
<div class="body2" >
<div id = "fundo" class="bodyoff">
<div class="main">
<!-- header -->
<header>
<div id="a">
<h1><a id="logo" class="normaltip" title="Under Construction!"></a>
</div>
</header>
<div class="ic">myweb.com.br</div>
<!-- / header -->
<!-- content -->
<div class="inner">
<div class="kwiks_wrap">
</div>
</div>
<!-- / content -->
<!-- footer -->
<footer>
<div class="wrapper">
<ul id="icons">
<li><a href="#" class="normaltip" title="Facebook"><img src="images/icon1.png" alt=""></a></li>
<li><a href="#" class="normaltip" title="Twitter"><img src="images/icon4.png" alt=""></a></li>
</ul>
</div>
Support <a rel="nofollow" href="http://www.example.ufmg.br/" target="_blank">Inovation</a> - Example <br>
</footer>
<!-- / footer -->
</div>
</div>
</div>
<script>
$("#logo").click(
function(){
$("#fundo").fadeToggle("body2");
}
);
</script>
</body>
</html>
The difference between "body2" and "bodyoff" are just the 'background' image. Wy isn't working correctly ??
Some styles declared:
.bodyoff {
background: url(../images/bg_img_turnoff.jpg) top center no-repeat;
height: 100%;
min-height: 745px; }
.body2 {
background: url(../images/bg_img.jpg) top center no-repeat;
height: 100%;
min-height: 745px; }
h1 {
float: left;
padding: 114px 0 0 63px; }
#logo {
display: block;
background: url(../images/logo.png) repeat;
width: 319px;
height: 86px;
text-indent: -9999px; }
What i'm doing wrong? The logo shouldn't disappear... should it ? :/