📜 ⬆️ ⬇️

JQuery based timepicker

Recently, I (to be exact, not exactly me) had the need to insert such a thing as a teampicker into one project.
Fate and kind people put me first on the horrible dial based on MooTools, and then on the jQuery Timepicker plugin .

Due to the fact that I use jQuery, the plugin was examined and even built into the project, but immediately I ran into a number of problems.
First , it requires the entire ui library (and this is 200 kilo of code) and nowhere (I did not find it) there are no dependencies, so that you can isolate extra kilobytes of code.
Secondly , it requires several css files that inherit from ui.core.css.
Thirdly , it requires a couple of decent sprites.
After connecting this whole story, I received a not fully working timekeeper (problematic styling due to the presence of other elements of the ui library) and page fading. This is not to mention the fact that I do not like the presence of AM / PM switches, hard (well, or not, I do not remember its config) binding to 15 minute intervals and a strange appearance.

So I had to write my bike, which was successfully integrated into the project. Naturally, I got the idea that perhaps there would be people who could use my little crooked script for some devil. So I spent another hour on the demo script. You can see (and extract all sources) here - public.xfenix.ru
')
PS Doped decadently to work in the state of browsers IE (6.7), Opera, FF 3, Google Chrome. For IE, I had to make conditional comments, and for the opera it was hard to blink (and still the bug remained - the background is applied only half li when clicked). If anyone explains why such errors have arisen and how to overcome them a little more than completely, then I will be grateful until the end of the century.

PPS If suddenly, by some miracle, you, the reader, are not a bison at all, sneering at my source files, but a javascript novice addict and you need a description of the connection and options of this script, then you can tell me about it in comments and then I will and I will add a couple of paragraphs of text.

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


All Articles