2 Replies - 585 Views - Last Post: 13 March 2010 - 09:19 PM

#1 heyoman1  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 64
  • View blog
  • Posts: 735
  • Joined: 30-November 09

Need css/javascript/html help!

Posted 12 March 2010 - 04:35 PM

I need help with this site. Here is the .html

<html>
<head>
<link rel="stylesheet" type="text/css" href="index.css" />
<script type="text/javascript">
function MakeVisible(tab, element){
<!-- get an array with div elements -->
var links = document.getElementsByTagName("div")
<!-- search array for link boxes, and hide them -->
for (var j = 0; j < tabs.length; j++){
if (links[j].className == 'links') links[j].style.display = "none"
}
<!-- find the element and unhide it -- >
var element = document.getElementById(element)
element.style.display = "block"
}
</script>
</head>
<body>
<div style="text-align: center;">
<img src="C:\New Folder\banner.jpeg" alt="duh?" />
<br>
<span class="tab" onmouseover="MakeVisible('Home')">Home</span>
<span class="tab" onmouseover="MakeVisible('Apps')">Apps</span>
<span class="tab" onmouseover="MakeVisible('AboutMe')">About Me</span>
<span class="tab" onmouseover="MakeVisible('ContactMe')">Contact Me</span>
<div id="Home" class="links">
<a href="index.html">Home</a>&nbsp;
</div>
<div id="Apps" class="links">
<a href="allapps.html">All apps</a>&nbsp;
<a href="highlypraisedapps.html">Highly Praised Apps</a>&nbsp;
<a href="editorspickapps.html">Editor's Pick</a>&nbsp;
</div>
<div id="AboutMe" class="links">
<a href="aboutme.html">About Me</a>&nbsp;
</div>
<div id="ContactMe" class="links">
<a href="contactme.html">Contact Me</a>&nbsp;
</div>
</div>
</body>
</html>



and the css

.tab{
font-weight: bold;
padding: 5px;
border-style: solid;
border-width: 1px;
}

.links{
display: none;
border-width: 1px;
border-style: solid;
padding: 10px;
background-color: lightyellow;
font-size: small;
}



i want the menu to be a collapsable menu, but in this code, all of the links show at once. Please help.

Is This A Good Question/Topic? 0
  • +

Replies To: Need css/javascript/html help!

#2 robhilly  Icon User is offline

  • New D.I.C Head

Reputation: 6
  • View blog
  • Posts: 46
  • Joined: 26-May 08

Re: Need css/javascript/html help!

Posted 13 March 2010 - 01:07 AM

I'll keep this simple. Look at the first argument in your function declaration:

function MakeVisible(tab, element){


Then look at this statement within the function:

for (var j = 0; j < tabs.length; j++){


Correct Syntax.

Edit01: Not So simple. More errors even after fix. Need to mess with this a bit before being so confident...

This post has been edited by robhilly: 13 March 2010 - 01:12 AM

Was This Post Helpful? 0
  • +
  • -

#3 heyoman1  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 64
  • View blog
  • Posts: 735
  • Joined: 30-November 09

Re: Need css/javascript/html help!

Posted 13 March 2010 - 09:19 PM

View Postrobhilly, on 13 March 2010 - 12:07 AM, said:

I'll keep this simple. Look at the first argument in your function declaration:

function MakeVisible(tab, element){


Then look at this statement within the function:

for (var j = 0; j < tabs.length; j++){


Correct Syntax.

Edit01: Not So simple. More errors even after fix. Need to mess with this a bit before being so confident...


alright, thanks for helping! please post back when you find the answer
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1