开发者

JQuery Mobile ui-datepicker theme

开发者 https://www.devze.com 2023-02-28 14:44 出处:网络
I am tryi开发者_StackOverflow中文版ng to change the ui-datepicker theme to \"a\" but it doesn\'t seem to inherit it.

I am tryi开发者_StackOverflow中文版ng to change the ui-datepicker theme to "a" but it doesn't seem to inherit it.

Does anyone know how to change the theme for the datepicker please?

Thanks


As @Jayraj mentioned, the datepicker for jQueryMobile is still in an experimentation phase, but I've had a moderate amount of success in manually changing the layout themes set by default in the jQueryMobile datepicker widget (jquery.ui.datepicker.mobile.js).

The following elements are giving a default data-theme of 'c' (through their class names) :

$( ".ui-datepicker-calendar th", dp ).addClass("ui-bar-c");
$( ".ui-datepicker-calendar td", dp ).addClass("ui-body-c");

As well as the following style for a ui-btn-up widget with a data-theme of 'e':

$( ".ui-datepicker-calendar a.ui-state-highlight", dp ).addClass("ui-btn-up-e");

Changing these values to

ui-bar-a 
ui-body-a
ui-btn-up-c 

respectfully have yielded expected results, but I would imagine that making these values dynamic by changing them based on the options passed in would be a much better solution :3


The jQuery Mobile CSS file does not contain any classes for ui-datepicker or anything similar. The datepicker is also given as experimental on the jQuery Mobile documentation site. It probably isn't possible right now

0

精彩评论

暂无评论...
验证码 换一张
取 消