PDA

View Full Version : n00b needs help :)


PsycoMikeJr
06-21-2003, 02:14 AM
Hey everyone! Thanks for taking your time looking
in on my problem :)

This is my site:
URL removed by admin as requested

Notice the band logos down on the right side?
That's where my problem is.
I want them to work as a pulldown menu as shown here:

URL removed by admin as requested
This works like a charm! You can click the logo, and
the tab links pop down. But when I add more than one,
they don't work, as shown here:

URL removed by admin as requested
Totally dead :(

The Javascript I use is this:
--------------------------------------------------------------
SCRIPT LANGUAGE="JavaScript"

!-- This script and many more are available free online at --
!-- The JavaScript Source!! URL removed by admin as requested
!-- Original: Roberto Ortali (ortiz83@libero.it) --

!-- Begin
var refer=true;
function combo() {
if (refer) {
document.all.contents.style.visibility="visible";
refer=false;
}
else {
document.all.contents.style.visibility="hidden";
refer=true;
}
}
// End --
/script
--------------------------------------------------------------

I tried browsing the Javascript site, but I don't know what things
liked that are called in English, nor Norwegian for that matter

PS I'm a total n00b when it comes to things like this, so give me an
easy explanation, ok?

Skyzyx
06-21-2003, 03:03 AM
First of all, never use document.all... ever... for anything. It's proprietary to Microsoft, and in doing so, you make your site inaccessable to innumerable browsers.

Secondly, you can only have one ID of a kind. If you use id="content" once, you cannot use "content" for an id again on the same page. You'll need to select something else. I've made some changes to the code, and now it works in all modern browsers.

I also re-wrote the script so that you can tell the script what ID to show/hide.


<html>
<head>


<script language="JavaScript" type="text/javascript">
<!--
// This script and many more are available free online at
// The JavaScript Source!! URL removed by admin as requested
// Original: Roberto Ortali (ortiz83@libero.it)

// Begin
var refer=true;
function combo(divId) {
if (refer) {
document.getElementById(divId).style.visibility="visible";
refer=false;
}
else {
document.getElementById(divId).style.visibility="hidden";
refer=true;
}
}
// End -->
</script>

</head>
<style type="text/css" text="white">
<!--A { text-decoration:none }-->
<!--
A:active { color:white; text-decoration; }
A:hover { color:#FF0000; text-decoration: none; }
//-->

</STYLE>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<body bgcolor="black" link="yellow">
<table align="center">
<tr><td>
<table width="240" border="black" cellspacing="0" cellpadding="0" bordercolor="black">

<tr>
<td align="right" width="21">
<img src="ironm.gif" name="combo_arrow" width="240" height="50" alt="" border="0" onclick="combo('ironmaiden');" ></td>
</tr>
</table>
<div id="ironmaiden" style="position:absolute; left:?px; top:?px; width:?px; height:?px; z-index:1; visibility:hidden">
<table width="240" border="black" cellspacing="black" cellpadding="black" bordercolor="black">
<tr>
<td bgcolor="black">

<font face="verdana" size="2">
<a href="acesolo.txt" target="_blank"> <img src="img/bullet2.gif" border="0" width="8" height="8"> Aces High Solo</a><br></font>
<a href="atsssolo.txt" target="_blank"> <img src="img/bullet2.gif" border="0" width="8" height="8"> Aftraid To Shoot Strangers Solo</a><br>
<a href="foicasolo.txt" target="_blank"> <img src="img/bullet2.gif" border="0" width="8" height="8"> Flight of Icarus Solo</a><br>

</td>
</tr>
</table>
</td></tr>
</table>

<table align="center">
<tr><td>
<table width="240" border="black" cellspacing="0" cellpadding="0" bordercolor="black">
<tr>

<td align="right" width="21">
<img src="classical.jpg" name="combo_arrow" width="240" height="50" alt="" border="0" onclick="combo('classical');" ></td>
</tr>
</table>
<div id="classical" style="position:absolute; left:?px; top:?px; width:?px; height:?px; z-index:1; visibility:hidden">
<table width="240" border="black" cellspacing="black" cellpadding="black" bordercolor="black">
<tr>
<td bgcolor="black">
<font face="verdana" size="2">

<a href="" target="_blank"> <img src="img/bullet2.gif" border="0" width="8" height="8"> Gadd ikke</a><br></font>
<a href="" target="_blank"> <img src="img/bullet2.gif" border="0" width="8" height="8"> Og Sette Inn</a><br>
<a href="" target="_blank"> <img src="img/bullet2.gif" border="0" width="8" height="8"> Noen Andre Linker</a><br>
</td>

</tr>
</table>
</td></tr>
</table>

</body>
</html>

PsycoMikeJr
06-21-2003, 10:13 AM
Thanks man!!!
You've been a ton of help! At last
I'll get around to update my site :thumbsup:

PS I want to say sorry to the admins and mods
for not following the rules. The name for my thread
is kind of rule breakin... sorry!
Didn't see the sticky before now...

Thanks again!