So for my website I am trying to create a more button, and a menu will pop up when I create this. There is a picture of an arrow for more, and a picture of a down arrow for less. I have the javascript code done, but it won't switch back from the down arrow to the up one. I would like to see if one of you can solve this. Here is my website http://spencedesign.netau.net/singaporehomemenu.html (don't worry I am going to make the arrows look better).
And here's my code
<html>
<head>
<title> Home </title>
<script type="text/javascript">
function showMore() {
if (more.style.display != "none") {
more.style.display = "none";
}
else {
more.style.display = "block";
}
}
imgs=Array("more.png","less.png");
var x=0;
function change() {
document.getElementById("more").src=imgs[++x];
if (x==1) {
x=0;
}
}
if (!imgs[x+1]) {
x=-1;
}
</script>
#bottomCorner
{
position: fixed;
bottom: 5px;
right: 5px;
z-index: 999;
width: 300px;
height: 30px;
display: block;
background-color: #fff;
opacity: 0.8;
filter: alpha(opacity=80);
text-align: center;
font-family: sans-serif;
}
#bottomCorner p
{
margin-top: 7px;
}
#menu
{
width: 300px;
height: 60px;
position: fixed;
right: 5px;
bottom: 40px;
opacity: 0.8;
filter: alpha(opacity=80);
text-align: center;
cursor: pointer;
border: 2px solid black;
}
</style>
<head>
<!--[if IE]>
<img src="iehomepagecss.png" width="1500" height="625" />
<script>
alert("This website does not support your browser");
</script>
<![endif]-->
<!--[if !IE]> -->
<body>
<div id="background" >
<div id="container" >
<div id="link1" >
<a href="http://www.spencedesign.netau.net/singapore.html" > Gallery </a></li>
</div>
<div id="link2" >
<a href="http://www.spencedesign.netau.net/singapore.html" > Tour </a></li>
</div>
<div id="link3" >
<a href="http://www.spencedesign.netau.net/singapore.html" > Facts </a></li>
</div>
<div id="link4" >
<a href="http://www.spencedesign.netau.net/singapore.html" > Author </a></li>
</div>
<div id="bottomCorner"><p> <font family="sans-serif"> Hello </font></p> </div>
<div id="menu"> <img id="more" src="more.png" alt="more" onclick="change()" width= "300px" onclick="showMore()"/> </div>
</div><!--Container-->
</div><!--Background-->
</body>
</html>
There is other CSS, I just included the relevant code