U
U
un1t2010-12-24 08:57:29
JavaScript
un1t, 2010-12-24 08:57:29

Layout of drop-down lists

When you need not just a drop-down list, but a beautifully designed drop-down list, layout designers use various javascripts. All of these scripts work in much the same way. The select tag is replaced with a bunch of div tags. The simplest actions - the selection of an element of the list is performed. But if we need a little more complicated, for example, to attach a function to the onchange drop-down list event, then this no longer works. Tell me how this problem is solved or in which scripts for registration of additional downs, this problem was initially solved.

Answer the question

In order to leave comments, you need to log in

7 answer(s)
N
Nikolai Vasilchuk, 2010-12-24
@Anonym

If you replace the list with a bunch of divs, then you will no longer need to process onchange, but, for example, onclick on the div, and, optionally, change the list there so that onchange works. Something like this.

V
Vorchun, 2010-12-24
@Vorchun

See examples here: css.maxdesign.com.au/listamatic/

J
jamayka, 2010-12-24
@jamayka

In jQuery, for example (I think in any other serious framework), you can fire events custom. For example, here is the jQuery custom selectboxes plugin . If specifically on this page to execute:

$('#default-usage-select').change(function() { alert(this.value); });

And then select a color in the demo select, then its value will be alerted.

L
loat, 2010-12-24
@loat

here you can choose what you like - www.queness.com/post/204/25-jquery-plugins-that-enhance-and-beautify-html-form-elements
I personally like this one the most - www. dfc-e.com/metiers/multimedia/opensource/jqtransform/
I think it's not a problem to write a function for the drop-down list event yourself.

E
elisium, 2010-12-24
@elisium

When using jquery, you can generate an event yourself via trigger('change').

C
ChemAli, 2010-12-24
@ChemAli

And why do you need selects at all with such Wishlist? Javascript and hidden field. All hooks are in javascript.

R
Riateche, 2010-12-24
@Riateche

I once wrote such a plugin for myself (the problem in the existing ones was just on onchange). I advise you to do the same, there will be less problems later.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question