问题
I have incorporated a jquery datepicker into my application however no matter what theme I select the prev/next icons do not show. I have used a different version of the jquery-ui.js too. I have tried a couple of items I had seen previously posted like - using 'hideIfNoPrevNext' or
$( ".date" ).datepicker( "option", "changeMonth", true );
One suggestion that I cannot find is where the 'image' folder is located. I have looked in the jquery-ui.js and the theme.css.
In my code I reference the files in this order:
<link href="js/ui_1.10.4_themes_smoothness_jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.10.js" type="text/javascript"></script>
<script src="js/jquery_ui_1.11.4_jquery-ui.js" type="text/javascript"></script>
and in the theme it references the icons as:
.ui-widget-content .ui-icon {
background-image: url(images/ui-icons_222222_256x240.png);
}
.ui-widget-header .ui-icon {
background-image: url(images/ui-icons_222222_256x240.png);
}
.ui-state-default .ui-icon {
background-image: url(images/ui-icons_888888_256x240.png);
}
.ui-state-hover .ui-icon,
.ui-state-focus .ui-icon {
background-image: url(images/ui-icons_454545_256x240.png);
}
.ui-state-active .ui-icon {
background-image: url(images/ui-icons_454545_256x240.png);
}
.ui-state-highlight .ui-icon {
background-image: url(images/ui-icons_2e83ff_256x240.png);
}
.ui-state-error .ui-icon,
.ui-state-error-text .ui-icon {
background-image: url(images/ui-icons_cd0a0a_256x240.png);
}
回答1:
When downloading jQuery-UI you should get a zip file that will contain the images folder you are looking for. These will need to be including with your project in order for the icons to properly show up. Including these depends on the type of web server you are using to serve your files.
回答2:
who reading this question, If you use this dateime picker http://www.malot.fr/bootstrap-datetimepicker/
You add this option: bootcssVer : 3
$( ".date" ).datepicker( "option", "changeMonth", true, **"bootcssVer" : 3** );
The icon will show!!!
回答3:
My problem was the text-indent was set to -99999px
and by patching it to be 0px
I fixed my issue.
来源:https://stackoverflow.com/questions/36017579/jqueryui-datepicker-prev-and-next-icons-not-showing