Connecting Tech Pros Worldwide Forums | Help | Site Map

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

User
Guest
 
Posts: n/a
#1: Dec 8 '06
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

Peter Michaux
Guest
 
Posts: n/a
#2: Dec 8 '06

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


Hi "User" <user@email>,

User wrote:
Quote:
>
Is it possible to transform Ordered/Unordered list into navigation dropdown
menus?
Very possible
Quote:
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

ASM
Guest
 
Posts: n/a
#3: Dec 8 '06

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


User a écrit :
Quote:
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.
Quote:
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
Mike Scirocco
Guest
 
Posts: n/a
#4: Dec 12 '06

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


User wrote:
Quote:
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
Closed Thread