Jump to content

Scroll effect and hide ?!


DeanWhitehouse

Recommended Posts

I have this code to show a second nav bar when they click on certain links. A few problems i am having are:

1. Changing the link that shows the second nav so when you click it again it hides the second nav>

2.I tried adding a sliding effect so it slides from the right , but mine didnt do anything , anyone know how to it?

3.Is there anyway to make this code more effcient as i think it isn't very well coded.

Any help apprciated ,

Thanks

Blade

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Draco Pangaia</title>
<link rel="stylesheet" href="style.css" media="screen"/>
<script type="text/javascript">
function show(amount,title,Link,title1,Link1,title2,Link2)
{
var page = "/template.php";
if(amount == 1)
{
var nav = "<li><a href="+Link+">"+title+"</a>";
}
if(amount == 2)
{
var nav = "<li><a href="+Link+">"+title+"</a></li><li><a href="+Link1+">"+title1+"</a></li>";
}
if(amount == 3)
{
var nav = "<li><a href="+Link+">"+title+"</a></li><li><a href="+Link1+">"+title1+"</a></li><li><a href="+Link2+">"+title2+"</a></li>";
}
document.getElementById("show").innerHTML=nav;
document.getElementById("new").innerHTML="<br>";
} 
alert(on);
function hide()
{
document.getElementById('show').innerHTML="";
document.getElementById("new").innerHTML="";
}
</script>
</head>
<body>
<div id="container">
<span id="title">
	Draco Pangaia
</span>

	<div id="navbar" align="left">
	<ul><li>Home</li><li>Story</li><li id="screen" onClick="show(2,'In game screens','screen.php?ingame','Pre Rendered','screen.php?pre');Slide()">Screenshots</li></ul>
	</div>
	<span id="new"></span>
	<div id="navbar" align="left"><ul id="show"></ul></div>
		<div id="maincontent">
		Welcome to the official game site for Draco Pangaia. 
		</div>

</div>
</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.