My HTML:
<!doctype html>
<html>
<head>
<title>Public Vision</title>
<link rel="stylesheet" type="text/css" title="backbone" href="backbone.css">
<link rel="alternative stylesheet" type="text/css" title="alt" href="alt.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>
<body class="style2">
<div id="header" class="style2"><div id="header2" class="style2">Public Vision</div></div>
<iframe width="640" height="400"
src="https://www.youtube.com/embed/videoseries?list=PLX9_I-EOJPdFuOjcI2zkmTck55homHEBE"
frameborder="2" allowfullscreen></iframe>
<input id="showHideContainer" type="image" src="off.jpeg " height="3%" width="2%" alt="On" onclick="toggle()";>
<script>
function toggle(){
$('body').toggleClass('style2');
}
</script>
<script>
document.getElementById('showHideContainer').onclick = function() {
divTest = document.getElementById('header');
if (divTest.style.display === "none") {
divTest.style.display = 'block';
}
else {
divTest.style.display = "none";
}
}
</script>
</body>
</html>
My CSS:
#header {height: 15%; width: 100%; background-color: white; z-index: 2; position: fixed; right:0; top:0;
box-shadow: 0 4px 4px -2px #232323;
-moz-box-shadow: 0 4px 4px -2px #232323;
-webkit-box-shadow: 0 4px 4px -2px #232323;
}
#header2{height: 15%; width: 100%; position: fixed; color:grey; opacity: 0.6; text-align: center; z-index: 4; font-size: 30px; margin-top: 2.5%; background-color:clear;}
iframe {display:block; margin: 0 auto; margin-top: 17%;}
body{
background-color:grey; z-index:3;
}
body.style2{
background-color:white; z-index:3;
}
Currently, the image I have now, when clicked makes the header disappear. any ideas on how I can make the image make the header disappear and the background change color? Really hitting a brick wall here. Thanks in advance!