📜 ⬆️ ⬇️

Selectik - Stylish Selects

Web designers love to style standard form elements. Then we have to implement these elements to us - the maker-up.

After dozens of projects, where I had to use third-party solutions, I was faced with the constant inventions of crutches, the lack of flexibility of ready-made plug-ins, the speed of generation.

Naturally, after all this, I decided to invent my bicycle.
')
The sample is designed without additional images using CSS3. Demo page with sandbox here .

Bicycle again?


For quite a long time I finished writing, created crutches when using ready-made plug-ins. The last straw was the fact that when writing Unit-tests, testers try to reach out, first of all, to the standard select, but this does not work, since most of the plug-ins that I used hide the standard select through “display = none”.

I also wanted to have an easy solution, quick generation (in IE, with a large number of selections on the page), working in the same way as the original selection.

The plug-ins that I used most often were repelled by events related to the already created structure of the stylized select. In the case of Selectik, the events are mostly hung on the original select.

The library decided to use jQuery for two reasons:

And so, what exactly is Selectik?


In the minify version, the weight of the script file is only 5.2 Kb. And with an additional plug-in (mouse wheel scrolling) and CSS in the demo example, 12.8 Kb. Gzip 2.1 kb / 4.7 kb respectively.

Supported browsers: IE7 +, latest versions of Chrome, Safari, Firefox.

Features currently implemented:
Parameters that can be used:
API:

In future

Project on github . Demo page with sandbox here .
I would be grateful if you can describe the errors / problems in the issue .

update
As znortil Connor , jQuery version 1.7+ is required due to the use of .on (). Most likely to be replaced by .bind ().

update 2
Thank you all for the comments and bugs. Within a week will be done.

Source: https://habr.com/ru/post/135953/


All Articles