/    Sign up×
Community /Pin to ProfileBookmark

Help—Adding a Submenu to my code

In the code below, how would I create a drop-down sub-menu?


<!– Begin

// NOTE: If you use a ‘ add a slash before it like this ‘

document.write(‘<TABLE cellpadding=”0″ cellspacing=”0″ border=”0″ WIDTH=”100%” background=”picts/background-menu.gif”><tr><td align=”right”>’);
document.write(‘<TABLE cellpadding=”0″ cellspacing=”0″ border=”0″><tr><td>’);
document.write(‘<img src=”picts/spacer.gif” width=”20″ height=”23″></a><br>’);

// START LINKS //

document.write(‘</td><td nowrap class=”menusize”>’);
document.write(‘<a href=”ourfirm.htm” class=”menu”>Our Firm</a><br>’);

document.write(‘</td><td nowrap class=”menusize”>’);
document.write(‘<a href=”practice.htm” class=”menu”>Practice Areas</a><br>’);

document.write(‘</td><td nowrap class=”menusize”>’);
document.write(‘<a href=”milcrimes.htm” class=”menu”>Military Crimes</a><br>’);

document.write(‘</td><td nowrap class=”menusize”>’);
document.write(‘<a href=”millaw.htm” class=”menu”>Military Law</a><br>’);

document.write(‘</td><td nowrap class=”menusize”>’);
document.write(‘<a href=”national.htm” class=”menu”>National</a><br>’);

document.write(‘</td><td nowrap class=”menusize”>’);
document.write(‘<a href=”media.htm” class=”menu”>Media</a><br>’);

// COPY AND PASTE THE NEXT 2 LINES TO ADD A NEW LINK //

document.write(‘</td><td nowrap class=”menusize”>’);
document.write(‘<a href=”index.html” class=”menu”>Home</a><br>’);

// END LINK BUTTONS //

document.write(‘</td><td>’);
document.write(‘<img src=”picts/spacer.gif” width=”10″ height=”23″></a><br>’);
document.write(‘</td></tr></table>’);
document.write(‘</td></tr></table>’);

// End –>

to post a comment
HTML

5 Comments(s)

Copy linkTweet thisAlerts:
@VladdyMay 12.2004 — Why tables?

Why document.write?

Menu is a (nested) list of links - that should be enough of a clue....
Copy linkTweet thisAlerts:
@jonathanhouauthorMay 12.2004 — this is a menu.js file
Copy linkTweet thisAlerts:
@VladdyMay 12.2004 — Get rid of it - making your navigation JS dependent is about the worst thing you can do to your web site.
Copy linkTweet thisAlerts:
@jonathanhouauthorMay 12.2004 — What code would I use for my pages to have a menu with a submenu?
Copy linkTweet thisAlerts:
@VladdyMay 12.2004 — A nested list of links.
×

Success!

Help @jonathanhou 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...