How to edit css for jquery datepicker prev/next buttons?

北城以北 提交于 2019-12-24 00:54:47

问题


Using the JQuery UI datepicker, in the header it gives you the option to go to the next month or previous month with left/right arrows. My question is what is the css property to change the colors when hovering over the previous or next arrows?


回答1:


It's a little harder than it seems. As NimChipsky pointed out, it's in ui-state-hover, but the colors aren't there directly.

If you look at ui-state-hover, out of the box, you will see something that looks like:

background-image: url("images/ui-icons_222222_256x240.png");

Basically, this is telling you that you will be using an icon sheet with color #222222, but the icon sheet graphic has to be available. You can generate other icon sheets directly, with other colors, by using the jQuery UI theme builder.




回答2:


ui-state-hover is the class that is applied when hovering, see here




回答3:


<script>
    $(".ui-datepicker-next, .ui-datepicker-prev").hover(function () {
        $(this).addClass("hover");
        },
    function () {
        $(this).removeClass("hover");
        });
</script>

and css for your class 'hover'

.hover
{
    background-image:url('paper.gif');
}


来源:https://stackoverflow.com/questions/8508779/how-to-edit-css-for-jquery-datepicker-prev-next-buttons

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