PDA

View Full Version : How do I...


Elethiomel
09-09-1999, 17:23
Create a drop-down list of links that expands when someone clicks it (i've seen it done)...e.g.

Main Link Here

/Click

Main Link Here
<UL TYPE=SQUARE>1st sublink
2nd sublink
3rd sublink</UL>

??

Erm...obviously the sub links should be directly under the main link, but the UBB &lt;list&gt; b0rks it up http://www.wireplay.co.uk/ubb/smile.gif

I've seen it done, and it's definitely not another frame being loaded...

Ele


[This message has been edited by Elethiomel (edited 09-09-1999).]

Grace
10-09-1999, 05:07
Umm... never done it before, but... http://www.wireplay.co.uk/ubb/smile.gif

This is the code:


<BLOCKQUOTE><font size="1" face="Arial, Helvetica">code:</font><HR><pre>
&lt;table cellpadding="0" cellspacing="0" align="center" width="105"&gt;
&lt;tr&gt;&lt;td&gt;&lt;font face="verdana, helvetica" size="2" color="#000000"&gt;&lt;b&gt;Click below&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;


&lt;tr&gt;&lt;td valign="top" align="center"&gt;

&lt;div align="center"&gt;&lt;FONT FACE="Arial, Helvetica" SIZE="3"&gt;&lt;FORM name="linkForm"&gt;&lt;SELECT SIZE=1 ONCHANGE="makeLinkTo(this);"&gt;


&lt;option VALUE=""&gt;Select&lt;/option&gt;

&lt;!-- Adding new url links here --&gt;


&lt;option VALUE="http://freespeech.org/etheria/submitlink1.html"&gt;Submit Link 1&lt;/option&gt;

&lt;option VALUE="http://freespeech.org/etheria/submitlink2.html"&gt;Submit Link 2&lt;/option&gt;

&lt;option VALUE="http://freespeech.org/etheria/submitlink3.html"&gt;Submit Link 3&lt;/option&gt;

&lt;/SELECT&gt;&lt;/FORM&gt;&lt;/font&gt;
&lt;SCRIPT&gt;

&lt;!--

//Make reference to the selected link

function makeLinkTo(s) { window.top.location.href =
s.options[s.selectedIndex].value; }

//--&gt;

&lt;/SCRIPT&gt;&lt;/DIV&gt;&lt;/td&gt;


&lt;/tr&gt;
&lt;/table&gt;
&lt;!--/navbar--&gt;
&lt;/TD&gt;
[/code]


It makes this (http://freespeech.org/etheria/submitlinks.html).

Go on, make it drop-down... you know you wanna. http://www.wireplay.co.uk/ubb/smile.gif


And of course to change the font size of 'Click below' or whatever text you want, just change the first font SIZE="" in front of the text. http://www.wireplay.co.uk/ubb/smile.gif Or just erase all the

<BLOCKQUOTE><font size="1" face="Arial, Helvetica">code:</font><HR><pre>
&lt;tr&gt;&lt;td&gt;&lt;font face="verdana, helvetica" size="4" color="#000000"&gt;&lt;b&gt;Click below&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
[/code]
if you don't want text at all. http://www.wireplay.co.uk/ubb/smile.gif

Where it says

<BLOCKQUOTE><font size="1" face="Arial, Helvetica">code:</font><HR><pre>&lt;div align="center"&gt;&lt;FONT FACE="Arial, Helvetica" SIZE="3"&gt;[/code]

you can change the size of the box by making it SIZE="0" or "1" or "2" and so on.


Like this (http://freespeech.org/etheria/submitlinks1.html) and this (http://freespeech.org/etheria/submitlinks2.html).


I like that last one.. hehehehee!! Huge!!


Umm... does that help? http://www.wireplay.co.uk/ubb/smile.gif I made it all up just for you, Ele, you know... http://www.wireplay.co.uk/ubb/wink.gif


[This message has been edited by Grace (edited 10-09-1999).]

Grace
10-09-1999, 05:30
Wow... everything seems so surprisingly clear at 1 in the morning. http://www.wireplay.co.uk/ubb/smile.gif

Elethiomel
10-09-1999, 08:29
Erm...Ta Grace, much appreciated (luv the messages http://www.wireplay.co.uk/ubb/wink.gif) but that's not quite what I meant...I don't want a combo box (that's what that thingy u've done would be called in Access), or a list like that, just a sub menu of links that opens when you click the first one..

Although I guess I could do it that way maybe...

Still, that code will come in useful anyway...ta muchly http://www.wireplay.co.uk/ubb/biggrin.gif

Ele


[This message has been edited by Elethiomel (edited 10-09-1999).]

Taulath
10-09-1999, 10:08
I think to get the sort of thing you want we're talking about CGI scripts and other complicated stuff... If you've seen it before tho and remember where, why not have a look at their source code? http://www.wireplay.co.uk/ubb/wink.gif

Grace
10-09-1999, 11:18
**sighs**

Hmm... I don't think I've seen what you are talking about then... what site have you seen it on?? http://www.wireplay.co.uk/ubb/smile.gif

Elethiomel
10-09-1999, 18:47
I um...can't remember. Doh.

Taulath: I don't mind complicated stuff, as long as it's not unintelligible complicated stuff...e.g. any Microsoft Office Help File http://www.wireplay.co.uk/ubb/wink.gif

Ele

Banana Man
11-09-1999, 02:52
Ele ive got a jave applet which does somthing like what you want, ICQ me n I'll send it you

------------------
ICQ 41336112 (http://wwp.icq.com/41336112#pager)
E-mail Banana_Man@BTinternet.com

Qui
11-09-1999, 09:52
*puts hand in air* me sir, please pick me sir, i know sir.

shhhhh, dont tell ne1, goto www.freeserve.co.uk (http://www.freeserve.co.uk) and click on a link not sure which one, which brings up exactly what ur talking about, click on tools which brings up a list of net tools http://www.wireplay.co.uk/ubb/wink.gif. It doesnt work with frames but in a non frame page it works really well. Takes a look of messing around to get the code cos the site is "single page" rather than framed.

Hope Ive wasted ur time again http://www.wireplay.co.uk/ubb/smile.gif

Regards,


Qui

PS Freeserve said once in their newsgroups that the best way to get code is to look at other ppls websites so they cant get ya for taking their code http://www.wireplay.co.uk/ubb/smile.gif. If u need ne help with it, Ill do it. Let me know.

Elethiomel
11-09-1999, 10:31
Yup, that's the one..ta Qui (that's not where I've seen it, but it's the same sort of thing)...it's here (http://www.freeserve.co.uk/fantasy_league/) - look at the navigation bar (books etc.). They've used Javascript for it, but it doesn't actually look that difficult (erm...well it doesn't look that difficult to a VB programmer, anyway http://www.wireplay.co.uk/ubb/wink.gif)

Ele

Qui
11-09-1999, 10:36
lol no probs http://www.wireplay.co.uk/ubb/teeth.gif

Qui
11-09-1999, 10:42
i converted it for my site in about half an hour, so u sould have noo problems http://www.wireplay.co.uk/ubb/smile.gif

Glad to be of service...

Rug
16-09-1999, 00:59
!

------------------
Clan Organiser &
Co-captain of CHAOS



[This message has been edited by Rug (edited 16-09-1999).]

Rug
16-09-1999, 13:03
!

------------------
Clan Organiser &
Co-captain of CHAOS AOE Clan Pages (http://www.btinternet.com/~daniel.kennedy/index.htm)
E-mail me (http://mailto:daniel.kennedy@btinternet.com)

Rug
16-09-1999, 13:06
!

------------------
Clan Organiser &
Co-captain of CHAOS

Age of Empires Clan Pages (http://www.btinternet.com/~daniel.kennedy/index.htm)

daniel.kennedy@btinternet.com


[This message has been edited by Rug (edited 16-09-1999).]

[This message has been edited by Rug (edited 16-09-1999).]

Rug
16-09-1999, 13:11
Sorry, it's pretty obvious what im doing here!!!

------------------
Clan Organiser &
Co-captain of CHAOS

Age of Empires Clan Pages (http://www.btinternet.com/~daniel.kennedy/index.htm)
daniel.kennedy@btinternet.com



[This message has been edited by Rug (edited 16-09-1999).]

Elethiomel
16-09-1999, 20:40
Ok, I've decided to go with Grace's code for what I'm doing, 'cos it makes more sense (I'm using it to build a help file for a d/base application I'm writing). The thing is...

The page I'm using it on is framed. And I want to change a different frame to the one that the drop down list is in...now from my VB experience I'm guessing that the answer to this lies somewhere in the bit of grace's code that says:

function makeLinkTo(s) { window.top.location.href = s.options[s.selectedIndex].value; }

Now I reckon that I need to change the .top. bit of it to something that references a different frame...but I don't know object/class/property/method names for JS, so I'm guessing here http://www.wireplay.co.uk/ubb/smile.gif. So what do I need to change it to to make it work?

Ta

Ele

Elethiomel
16-09-1999, 23:56
Ha! I found it!!! it's:

{ parent.frames[ index ].window.location.href = s.options[s.selectedIndex].value; }

Where Index is the index number of the frame you wish to change (enumerated starting at 0 - i.e. if you have 5 frames, the first one is 0, the last one is 4).

I found it here (http://www.htmlgoodies.com/js-ref/part2.html) , so Ta to Gracie for that...Dr. Burns does have an annoying habit of referring to what a VB programmer would call "Collections" as "Arrays", though. Maybe that's the correct terminology for Java or something...

Ele

[This message has been edited by Elethiomel (edited 16-09-1999).]