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

drop down lists with formatting and mouse events on items - tutorials?

100+
P: 310
I am not new to Javascript and have been working with it for years now. I have also written my own parent - child and parent - child - child drop down lists.

But when I look at some web sites, I see a lot of Javascript "parent - child" lists which are much nicer than what I am able to create. For example where the child drop down list is formatted, and includes a second column which can be clicked on to remove the entry, etc. etc.

Does anyone have a link to a site that shows some good open-source examples or tutorials so I can learn how to do stuff like this?

What I do not wish to do is to download some sort of complicated "it does everything" package that someone was nice enough to write and make available to everyone, since these are normally written in such a complicated fashion that it would take me days to reverse engineer it to find out what I want to know :)

So what I am looking for is a good tutorial kind of example that shows how to build up a list box that allows formatting and including mouse events on the individual elements, etc.

Any suggestions?

Thanks!
Sep 16 '08 #1
Share this Question
Share on Google+
2 Replies


rnd me
Expert 100+
P: 427
typically, the fancy formatting is more CSS than javascript.

most of the pre=paged solutions are in principle simple. it is the compatibility code to get cross-browser consistency reliable for the simple script.

you would be better off using a cohesion library like jquery, mootools, or prototype to make your menu. this removes a lot of tedious coding, allowing you to focus on the architecture of the menu system itself.

if you want to avoid any external code, i would do as much as possible in CSS, use as few javascript events as possible, and use HTML to build the actual menu that javascript adds behavoir to.

if you post some exmples of what you have done, i could suggest way to improve them or add features.

if you has a specific menu to duplicate in mind, a link to an example would let me be more specific about how to proceed from scratch or what you need to modify to your code.
Sep 16 '08 #2

100+
P: 310
Thanks, I think I see the point.

I was hoping to find some way to build up my own drop down list box that allowed me to do this fancy kind of formatting with as little code and extra functionalities as possible, hence a little tutorial on how it is done.

I wanted to avoid using someone else's open source free code because I did not want to add a lot of unnecessary complexity (due to extra functionality) to each of my pages. I did this once with an onmouseover tooltips library. It could do many more things than what I needed it to do, but it meant adding a huge amount of code and Javascript objects to each page request. And this particular one was implemented in a complicated way that disallowed my having my own onmouseover tags anywhere on the page :)

I wound up dropping the opensource tooltip code, taking the time to look in the code to learn what I needed to learn, and then wrote my own streamlined version.
Sep 17 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.