By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,684 Members | 1,824 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,684 IT Pros & Developers. It's quick & easy.

Fine. Now how about a working demo?

P: n/a
http://www.scit.wlv.ac.uk/~jphb/javascript/emenu.html

This site clearly shows in diagram form of my basic layout.
But he only explains what each function does.
There is no working sample I can find.

As a long shot, I wrote to the author to see if he does have one.

Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Richard wrote:
http://www.scit.wlv.ac.uk/~jphb/javascript/emenu.html

This site clearly shows in diagram form of my basic layout.
But he only explains what each function does.
There is no working sample I can find.

As a long shot, I wrote to the author to see if he does have one.


This is not a lonely hearts forum. Why do I, or anyone else care about
this site?
--
Zif
Jul 23 '05 #2

P: n/a
Richard wrote:
http://www.scit.wlv.ac.uk/~jphb/javascript/emenu.html

This site clearly shows in diagram form of my basic layout.
But he only explains what each function does.
There is no working sample I can find.

As a long shot, I wrote to the author to see if he does have one.


Did you try pasting his code into a new page? It works in my IE6,
Netscape 7.2, Firefox 1.0.

<script type="text/javascript">
var Shropshire = new Object();
Shropshire.Towns = new Array ("Bridgnorth","Ludlow","Shrewsbury","Telford");
Shropshire.Status = "contracted";
var Staffordshire = new Object();
Staffordshire.Towns = new Array
("Cannock","Lichfield","Stafford","Stoke","Uttoxet er");
Staffordshire.Status = "contracted";
var WestMidlands = new Object();
WestMidlands.Towns = new Array
("Birmingham","Coventry","Dudley","Sandwell","Wals all","Wolverhampton");
WestMidlands.Status = "contracted";
function doList(curr){
var ref = eval(curr.id);
if(ref.Status == "contracted") {
ref.Status = "expanded";
var list = document.createElement("ul");
var i;
for(i=0;i<ref.Towns.length;i++) {
var newText = document.createTextNode(ref.Towns[i]);
var newNode = document.createElement("li");
newNode.appendChild(newText);
list.appendChild(newNode);
}
curr.appendChild(list);
ref.Sublist = list;
}else{
curr.removeChild(ref.Sublist);
ref.Status = "contracted";
}
}
</script>
</head>

<body>
<ul>
<li id="Staffordshire" onclick="doList(this)">Staffordshire
<li id="Shropshire" onclick="doList(this)">Shropshire
<li id="WestMidlands" onclick="doList(this)">West Midlands
</ul>
Mike
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.