Valhalla Legends Forums Archive | Web Development | Easier Way?

AuthorMessageTime
R.a.B.B.i.T
http://www.liquid-server.org/liquidserver/index.php?page=protocol
I want to know if there is an easier way of having show/hide than using <span id="X"> and JavaScript.  I really dislike the code of that page, merely due to it's bulkyness.  It also gets annoyingly difficult to read.

IE:[code]
<font face="courier new" size="2">

<span id="protocol_click" onclick="setvis('protocol_full', '');">
<font size="3"><B>Protocol</B></font>
</span><BR>
<span id="protocol_full">
<span id="logon_click" onclick="setvis('login_sequence', '');">
&nbsp;&nbsp;&nbsp;&nbsp;<B>Logon sequence</B>
</span><BR>
<span id="login_sequence">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[For registered logins]<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;XLS_SERVERVERSION&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x01<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;XLS_LOGIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x02<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ELS_CHECKLOGIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x03<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;XLS_ENTERCHAT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x10<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[For unregistered logins]<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;XLS_SERVERVERSION&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x01<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;XLS_LOGIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x52<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RLS_CONFORM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x53<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;XLS_ENTERCHAT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x10<BR>
<BR>
</span>
<span id="headers_click" onclick="setvis('headers', '');">
&nbsp;&nbsp;&nbsp;&nbsp;<B>Headers</B>
</span><BR>[/code]and it goes on!
March 27, 2005, 1:51 AM
peofeoknight
ARGH... I HAD TO TURN ON JAVASCRIPT TO GET TO THE CONTENT.

Basically you are going to have to use that onclick event handler to do what you seek. But I suggest that the div that the content is in be visible normally and then onpageload you make it invisible. That way people are going to be able to get to the content reguardless of weather they are part of the 10% of the internet that uses javascript or not.

Also, no there is not a better way to do it, but using the <span> is not really correct, you would be better off using a <div> I think... because <span> is inline.
March 27, 2005, 4:58 AM
kamakazie
Why not use <pre> instead of all those ugly spaces (&nbsp;)? You probably want to make the clicky-things look like links as well. When I first arrived at the page I didn't know what you were talking about until I read the rest of your post.
March 27, 2005, 9:04 AM
R.a.B.B.i.T
Hah!  Pre...I knew there was a tag for that, but I forgot it, thanks.  Also, I'm not done it all.  I was planning on adding little arrow images as a hint for clicking, but I 'spose I could link-like them.
March 27, 2005, 5:16 PM

Search