/    Sign up×
Community /Pin to ProfileBookmark

looking for a menu example

i am looking for a simple menu example
with items and sub itmems
can any 1 help me with that?
thnaks in advance
PEleg

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangMay 13.2004 — <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>expanding and collapsing outline</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script type="text/javascript">
//<![CDATA[
<!--
function Toggle(num) {
var obj=document.getElementById('info'+num);
var sign=document.getElementById('s'+num);
// expand or collapse
if(obj.className=='expanded') {
obj.className='collapsed';
sign.innerHTML='+';
}
else {
obj.className='expanded';
sign.innerHTML='-';
}
}

// Find all elements in a container with class='expanded' and change to 'collapsed'
function CollapseContent() {
var IDnum, n_elms, elms=document.getElementById('content').getElementsByTagName('dd');
n_elms = elms.length;
for (var i=0; i < n_elms; i++) {
if(elms[i].getAttributeNode('class').value=='expanded') {
IDnum=elms[i].getAttributeNode('id').value.split('info');
Toggle(IDnum[1]);
}
}
}
onload=CollapseContent;
//-->
//]]>
</script>

<style type="text/css">
<!--
#container {
width:80%;
border:2px solid #06f;
background:#9cf;
color:#000;
}
#content {
}
li span {
font-family:"Courier New", Courier, monospace;
padding:0 5px;
}
.sign {
cursor: pointer;
color: blue;
text-decoration : none;
}
.expanded {display:block;}
.collapsed {display:none;}
-->
</style>

</head>
<body>
<div id="content">
<h2>content</h2>
<dl>
<dt id="dt1" onclick="Toggle('1');" class="sign"><span id="s1">-</span>Headline 1</dt>
<dd id="info1" class="expanded">content 1</dd>
<dt id="dt2" onclick="Toggle('2');" class="sign"><span id="s2">-</span>Headline 2</dt>
<dd id="info2" class="expanded">content 2
<dl>
<dt id="dt2.1" onclick="Toggle('2.1');" class="sign"><span id="s2.1">-</span>Headline 2.1</dt>
<dd id="info2.1" class="expanded">content 2.1
<dl>
<dt id="dt2.1.1" onclick="Toggle('2.1.1');" class="sign"><span id="s2.1.1">-</span>Headline 2.1.1</dt>
<dd id="info2.1.1" class="expanded">content 2.1.1</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</div>
</body>
</html>
Copy linkTweet thisAlerts:
@pelegk1authorMay 13.2004 — do u have an eample of amenu lik that

but with few menu headers that stand one by another

thnaks in advance

peleg
×

Success!

Help @pelegk1 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 5.19,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...