jquery UI datepicker 缺少样式/css [英] jquery UI datepicker is missing style/css
本文介绍了jquery UI datepicker 缺少样式/css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚在 angular 中搜索了这个日期选择器.问题是缺少样式/css:
I just googled this datepicker for use in angular. The problem is that the style/css is missing:
myApp.directive('calendar', function () {
return {
require: 'ngModel',
link: function (scope, el, attr, ngModel) {
$(el).datepicker({
dateFormat: 'yy-mm-dd',
onSelect: function (dateText) {
scope.$apply(function () {
ngModel.$setViewValue(dateText);
});
}
});
}
};
})
有谁知道如何修复样式?看起来像 jquery ui css 什么的?jsfiddle:http://jsfiddle.net/dingen2010/a6WDH/1/
Does anyone know how to fix the style? Looks like jquery ui css or something? jsfiddle: http://jsfiddle.net/dingen2010/a6WDH/1/
推荐答案
检查这个 JsFiddle你只需要添加 Ui.css在 jsFiddle lef 的 external recourse
选项卡中,您必须添加 Ui 的外部 css
Check this JsFiddle
you just needed to add Ui.css
In external recourse
tab on lef of jsFiddle u had to add external css of Ui
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
</head>
<body>
<p>Date: <input type="text" id="datepicker"></p>
</body>
</html>
这篇关于jquery UI datepicker 缺少样式/css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文