Forums

This topic is locked

Database Driven Menu Problem

Posted 26 Apr 2004 16:43:15
1
has voted
26 Apr 2004 16:43:15 Praveen Pinto posted:
Hi,

I have created a menu system, now it works but doesnt work the way i want it to work. Would be great if someone can tell me how to do it.

I have provided the url and the code below.

There are four links on the main page that come out of the table "Category" from the db. Clicking any of these takes us to default1.asp. With the sub links for the clicked categories which come out of the "SubCategory" table and so on. What i cant seem to figure out is, how do i place those sub links directly under the clicked link and not in another box elsewhere the way i have done it.

Please help this is driving me nuts.

www.create905.com/test

is the url where you can look at it.

www.create905.com/test/test.zip

is the url to download the code and the mdb files. its just 13.2 kb.

Replies

Replied 10 May 2004 18:35:09
10 May 2004 18:35:09 Tjerk Heringa replied:
Hi,

i have build a db-driven menu like that with help from a friend.
Checkout: www.axisstuifmeel.nl
This is a site for a client i use it in.
Is this similar to what you mean?

The client is allways right even if he is not.
Replied 17 May 2004 11:04:23
17 May 2004 11:04:23 Praveen Pinto replied:
Thanks TJerk, but that isnt the solution i was looking for.
Replied 17 May 2004 11:19:34
17 May 2004 11:19:34 Vince Baker replied:
Hi,

Please avoid posting the same topic twice in different forums.

I have removed the duplicate post.



Regards
Vince

DMX Talkzone Manager

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 18 May 2004 01:35:12
18 May 2004 01:35:12 Phil Shevlin replied:
Vince,

pwashere was the cross-poster that started all the moderating talk to begin with:

www.dmxzone.com/forum/topic.asp?TOPIC_ID=27984
Replied 18 May 2004 19:24:44
18 May 2004 19:24:44 Dave Thomas replied:
you can do this by hiding and showing the div.

put this in the head of the page
<pre id=code><font face=courier size=2 id=code><font color=red>
&lt;script language="JavaScript"&gt;
&lt;!--
function expand(param)
{
param.style.display=(param.style.display=="none"?"":"none";
}
//--&gt;
&lt;/script&gt;
</font id=red></font id=code></pre id=code>

and then use this in the body.

<pre id=code><font face=courier size=2 id=code><font color=red>
&lt;!-- Begin show-hide divs --&gt;
&lt;!-- Ultradav - www.dmxzone.com --&gt;
&lt;a href="javascript:expand(document.getElementById('category_1'))"&gt;Category 1&lt;/a&gt;
&lt;div id="category_1" width="150px" style="display:none"&gt;
CATEGORY 1 LINKS AND CONTENT HERE
&lt;/div&gt;
&lt;a href="javascript:expand(document.getElementById('category_2'))"&gt;Category 2&lt;/a&gt;
&lt;div id="category_2" width="150px" style="display:none"&gt;
CATEGORY 2 LINKS AND CONTENT HERE
&lt;/div&gt;
&lt;a href="javascript:expand(document.getElementById('category_3'))"&gt;Category 3&lt;/a&gt;
&lt;div id="category_3" width="150px" style="display:none"&gt;
CATEGORY 3 LINKS AND CONTENT HERE
&lt;/div&gt;
&lt;a href="javascript:expand(document.getElementById('category_4'))"&gt;Category 4&lt;/a&gt;
&lt;div id="category_4" width="150px" style="display:none"&gt;
CATEGORY 4 LINKS AND CONTENT HERE
&lt;/div&gt;
&lt;!-- End hide Show Divs --&gt;
</font id=red>
</font id=code></pre id=code>

I usually use this as a list, you may need to play with the code to make it fit your table etc..

the way you've done it, i'd remove the table on the left and replace it with a div, and nest the divs below inside it. you could make it look real sweet with a bit of css

but it works as an onClick on a link shows the panel,
then clicking the link again hides it, like a tree menu.

to see it in action look at
www.flexicomms.com/about.html

Regards,
Dave

[DWMX 2004]|[FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
If you like online gaming, please register @ www.nova-multigaming.com

Edited by - UltraDav on 18 May 2004 19:29:36

Reply to this topic