我正在使用jQuery simple timepicker(只是时间戳而不是datetimepicker),我无法让它显示出来。我正在使用modx 1.0.6 evolution并通过chunk将timepicker添加到opt-in表单中。
这是选择加入表单代码:
<div><input type="text" name="basic_example_2" id="basic_example_2" value="" /></div>
这是我的页面标题,我已经修改了所有jQuery文件应该是的位置,并且还使用JSlint检查了jQuery代码,它说它没关系:
<head>
<title>[(site_name)] | [*pagetitle*]</title>
<meta http-equiv="Content-Type" content="text/html; charset=[(modx_charset)]" />
<base href="[(site_url)]"></base>
<link rel="stylesheet" href="assets/templates/landing-page/layout.css" type="text/css" media="screen" />
<link rel="stylesheet" href="assets/templates/landing-page/modxmenu.css" type="text/css" media="screen" />
<link rel="stylesheet" href="assets/templates/landing-page/form.css" type="text/css" media="screen" />
<link rel="stylesheet" href="assets/templates/landing-page/modx.css" type="text/css" media="screen" />
<link rel="stylesheet" href="assets/templates/landing-page/print.css" type="text/css" media="print" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="[(site_url)][~11~]" />
<link rel="stylesheet" media="all" type="text/css" href="http://code.jquery.com/ui/1.8.23/themes/smoothness/jquery-ui.css" />
<link rel="stylesheet" media="all" type="text/css" href="assets/templates/landing-page/jquery-ui-timepicker-addon.css" />
<script src="manager/media/script/mootools/mootools.js" type="text/javascript"></script>
<script src="assets/templates/modxhost/drop_down_menu.js" type="text/javascript"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.8.24/jquery-ui.min.js"></script>
<script type="text/javascript" src="assets/templates/landing-page/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="assets/templates/landing-page/jquery-ui-sliderAccess.js"></script>
<script>
$(function() {
$( "#datepicker" ).datepicker({showAnim: 'slideDown'});
});
</script>
<script>
$('#basic_example_2').timepicker();
</script>
</head>
我试过这个:
$('#basic_example_2').timepicker({});
和此:
$(function() {
$('#basic_example_2').timepicker({});
});
和此:
$('#basic_example_2').timepicker();
以防万一我不认为它应该重要但是我已经将CSS添加到我的layout.css文件中了:
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
.ui-timepicker-div td { font-size: 90%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
.ui-timepicker-rtl{ direction: rtl; }
.ui-timepicker-rtl dl { text-align: right; }
.ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; }
答案 0 :(得分:0)
从块中删除JS文件,因为modx似乎在块中将它们剥离并直接在标记之间添加它们。希望这有助于其他人。