Why are the key elements of the anytime jQuery plugin blending in with the background/invisiblized?

柔情痞子 提交于 2019-12-13 06:27:36

问题


The anytime jQuery plugin has its key elements (current month, day, year, hour, etc.) "blanked out" as shown below. Why, but more importantly, how to put some starch back into those key elements?

BTW, this is in jsfiddle, so I don't have any "fancy" CSS working behind the scenes; the only CSS I've added is extremely minimal, to wit:

labelText {
    font-family: verdana;
    white-space: nowrap;
}

UPDATE

Still showing white text on a yellow background in Visual Studio/browserland:


回答1:


This has to be a problem with the styles in the jQuery UI theme that you are using, or with jsFiddle styles interfering with the styles. Really, you're much better off playing with files on your local computer than dealing with all of the weird interactions that take place when you bring a web-based development tool into the mix!




回答2:


Using Colorzilla to "eyedrop" the existing color scheme (the two colors the page uses), I was able to get the Anytime datetimepicker to look good:

...by adding this CSS:

#AnyTime--BeginTime .AnyTime-lbl { color: #405DA9; font-weight:bold}
#AnyTime--BeginTime .AnyTime-cur-btn { background-color:#405DA9; border:1px solid #E25811; color:#E25811 }

I find that Anytime is, as the download page says, "Der Mecedes, ach was, der Rolls-Royce des Datepicker-Plugins"

All I needed to do was download the CSS and js file, reference them in my page, bind them to my inputs like so:

AnyTime.picker("BeginDateTime");
AnyTime.picker("EndDateTime");

...add the CSS shown above, and voila! - a personalized, er... companyized, datetimepicker.

The other options that I tried were HTML5 time input element, but that is not very well supported by the various browsers, at least not yet, so that's not currently very practical; the jQueryUI datepicker (doesn't include a time element); and a "timeentry" plugin that does not support seconds (only minutes and hours). I find that Anytime looks better, and combines both date and time data in one widget. Its usage is (to me) a little unconventional (perhaps due to its non-jQuery heritage), but it works well and, again, looks good, so...I'm more than happy with it.



来源:https://stackoverflow.com/questions/16289374/why-are-the-key-elements-of-the-anytime-jquery-plugin-blending-in-with-the-backg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!