本文介绍了jQuery UI的日期选择器丢失的风格/ CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只是用Google搜索这个日期选择器中使用的角度。问题是,风格/ 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:
推荐答案
勾选此
你只需要增加Ui.css
在外部追索权
标签LEF的jsfiddle的ü不得不加UI的外部CSS
Check this JsFidddleyou just needed to add Ui.cssIn 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的日期选择器丢失的风格/ CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!