/    Sign up×
Community /Pin to ProfileBookmark

ARGH! can’t hide menu items

Okay, I’m using menu.js which contains the following text:

function show(i) {
var k = document.getElementById(i);
k.style.visibility = “visible”;
}

function hide(i){
var k = document.getElementById(i);
k.style.visibility = “hidden”;
}

And I’m using it on the following page:

<script>
self.resizeTo(625,666);
</script>

<html>
<head>
<link rel=”stylesheet” type=”text/css” href=”main.css”>
<script type=”text/javascript” src=”menu.js” language=”javascript”></script>
</head>
<body background=”./images/sextant_main.jpg”>

<table>
<div id=”menuItems”>
<tr>&nbsp;</tr>
<tr>&nbsp;</tr>

<tr><td>
<a href=”#” onClick=”javascript:show(‘expect’);hide(‘pmap’);hide(‘admin’);hide(‘logout’);”><img

src=”./images/main.jpg” border=”0″></a></div>
</td><td><div id=”expect”><a href=”addemployee.php”>write an expect</a><br><br>
<a href=”addGroup.php”>delete an expect</a><br><br>
</div></td></tr>

<tr><td>
<a href=”#” onClick=”javascript:hide(‘expect’);show(‘pmap’);hide(‘admin’);hide(‘logout’);”><img

src=”./images/main.jpg” border=”0″></a></div>
</td><td><div id=”pmap”><a href=”deleteemployee.php”>write a pmap from scratch</a><br><br>
<a href=”delgroup.php”>write a pmap from an existing expect</a><br><br>
</div></td></tr>

<tr><td>
<a href=”#” onClick=”javascript:hide(‘expect’);hide(‘pmap’);show(‘admin’);hide(‘logout’);”><img

src=”./images/main.jpg” border=”0″></a></div>
</td><td><div id=”admin”><a href=”deleteemployee.php”>change the db</a><br><br>
<a href=”delgroup.php”>change your password</a><br><br>
</div></td></tr>

<tr><td>
<a href=”#” onClick=”javascript:hide(‘expect’);hide(‘pmap’);hide(‘admin’);show(‘logout’);”><img

src=”./images/main.jpg” border=”0″></a></div>
</td><td><div id=”logout”><a href=”deleteemployee.php”>logout</a><br><br>
</div></td></tr>

</div>
</table>

</html>

I know I repeat the same .jpg, I’m just trying to get functionality. HELP!!! PLEASE!!! Many hours now I’ve banged my head against this.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@PittimannJan 19.2004 — Hi!

You can try this, if you like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Untitled</title>

<link rel="stylesheet" type="text/css" href="main.css">

<script type="text/javascript" src="menu.js" language="javascript"></script>

<script language="JavaScript" type="text/javascript">

<!--

self.resizeTo(625,666);

//-->

</script>

</head>

<body>

<body background="./images/sextant_main.jpg" onload="hide('expect');hide('pmap');hide('admin');hide('logout');">

<table>

<div id="menuItems">

<tr> </tr>

<tr> </tr>

<tr><td>

<a href="#" onClick=" javascript:show('expect');hide('pmap');hide('admin');hide('logout');"><img

src="./images/main.jpg" border="0"></a></div>

</td><td><div id="expect"><a href="addemployee.php">write an expect</a><br><br>

<a href="addGroup.php">delete an expect</a><br><br>

</div></td></tr>

<tr><td>

<a href="#" onClick=" javascript:hide('expect');show('pmap');hide('admin');hide('logout');"><img src="./images/main.jpg" border="0"></a></div>

</td><td><div id="pmap"><a href="deleteemployee.php">write a pmap from scratch</a><br><br>

<a href="delgroup.php">write a pmap from an existing expect</a><br><br>

</div></td></tr>

<tr><td>

<a href="#" onClick=" javascript:hide('expect');hide('pmap');show('admin');hide('logout');"><img

src="./images/main.jpg" border="0"></a></div>

</td><td><div id="admin"><a href="deleteemployee.php">change the db</a><br><br>

<a href="delgroup.php">change your password</a><br><br>

</div></td></tr>

<tr><td>

<a href="#" onClick=" javascript:hide('expect');hide('pmap');hide('admin');show('logout');"><img src="./images/main.jpg" border="0"></a></div>

</td><td><div id="logout"><a href="deleteemployee.php">logout</a><br><br>

</div></td></tr>

</div>

</table>

</body>

</html>

If it looks reasonable to you, please use the attached textfile instead of copying the code (pasting it here produced linebreaks where they are not supposed to be).

Cheers Pit

[upl-file uuid=973be08d-a8b5-46d1-b88a-8b7b55b873b6 size=2kB]questor26.txt[/upl-file]
Copy linkTweet thisAlerts:
@questor26authorJan 19.2004 — ah thank god. thank you!
×

Success!

Help @questor26 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...