469,645 Members | 1,984 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

Ordered List/ UnOrdered List -> Transform them into drop down menus

Hi,

Is it possible to transform Ordered/Unordered list into navigation dropdown
menus?

Is this effect achieved by CSS? or via Javascript?

PLease advise

Thanks.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Dec 8 '06 #1
3 3272
Hi "User" <user@email>,

User wrote:
>
Is it possible to transform Ordered/Unordered list into navigation dropdown
menus?
Very possible
Is this effect achieved by CSS? or via Javascript?
One or both.

See some of the books by Eric Meyer for css versions and the necessary
Internet Explorer workarounds. Search the css-discuss email list
archives for more info.

See Stuart Langridge sitepoint book for a general idea of how this
might be done with JavaScript with more options than a pure CSS
dropdown menu can have. Or even
http://alistapart.com/articles/dropdowns/ but don't assume either of
these versions to be perfect unless you know the code is good.

Peter

Dec 8 '06 #2
ASM
User a écrit :
Is it possible to transform Ordered/Unordered list into navigation dropdown
menus?
A dropdown menu or tag select is used with form to send a variable (name
of select) with choice made (option selected)

How do you expect to get this feature with an ordered/unordered list ?

Probably using css you'll can give appearence of dropdown list to
another kind of list but certainly not selector html behavior.
Is this effect achieved by CSS? or via Javascript?
JavaScript with DOM

<script type="text/javascript">

function changeList(listId, selectorName) {
var L2 = document.createElement('SELECT');
L2.name = selectorName;
var L1 = document.getElementById(listId);
var L1o = L1.getElementsByTagName('LI');
for(var i=0; i<L1o.length; i++) {
var o = document.createElement('OPTION');
o.text = o.value = L1o[i].innerHTML;
L2.appendChild(o);
}
document.body.replaceChild(L2, L1);
}
</script>

<ul id="list1">
<li>menu 1</li>
<li>menu 2</li>
<li>menu 3</li>
<li>menu 4</li>
</ul>

<button onclick="changeList('list1', 'choice')">change lists</button>
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Dec 8 '06 #3
User wrote:
Is it possible to transform Ordered/Unordered list into navigation dropdown
menus?
Is this effect achieved by CSS? or via Javascript?
You can do a lot with CSS. Have you looked at this site:

http://css.maxdesign.com.au/index.htm

Can you do what you want with any of the lists there?

If not do you have an example of a menu you want to replicate (url)?

Mike
Dec 12 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Stanimir Stamenkov | last post: by
3 posts views Thread by David Ross | last post: by
6 posts views Thread by Stephen Miller | last post: by
33 posts views Thread by Jim Cobban | last post: by
210 posts views Thread by Christoph Zwerschke | last post: by
41 posts views Thread by Rene Nyffenegger | last post: by
1 post views Thread by shapper | last post: by
2 posts views Thread by asc4john | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.