jquery - 如何将日期选择器的日历图标放在 div 或 table 中
问题描述
我想将日期选择器的“calendar.png”图标放在 div 甚至表格中。目标是能够将其放置在我想要的任何位置。有了这个,我设法把它放在我想要的地方:
.ui-datepicker-trigger {
position: absolute;
left: 260px;
top: 200px;
}
但我想把它放在 div 或 table 中。只有日历图标不是整个日历。
$(document).ready(function() {
$('#demoDate').datepicker({
showOn: "both",
buttonImage: "calendar.png",
buttonImageOnly: true
});
});
#container * {
vertical-align: middle
}
body .fondo {
/*: 100px;*/
margin-left: auto;
margin-right: auto;
position: absolute;
}
.widget {
top: 50px;
margin-left: auto;
margin-right: auto;
position: absolute;
}
<!DOCTYPE html>
<html>
<head>
<title>jQuery UI Date Picker : buttonImage and buttonImageOnly </title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.3/themes/hot-sneaks/jquery-ui.css" />
<script src="https://code.jquery.com/jquery-2.1.3.js"></script>
<script src="https://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<style>
</style>
</head>
<body>
<div id="container" class="widget">
<input id="demoDate" class="fondo" />
</div>
</body>
</html>
解决方案
推荐阅读
- css - 避免屏幕调整大小时菜单按钮的闪烁效果
- mysql - Sql 查询以显示 NULL 行
- sql-server - 标识父存储过程中最后调用的存储过程名称
- c# - 通过 WMI .NET C# 检索硬盘驱动器信息
- sql - 多值属性规范化的优化结构
- c# - 无法在 UWP 中通过 UDP 发送数据
- airflow - 如何使用 Data Profiling --> Ad Hoc Query 列出 Airflow 中所有失败的任务
- c++ - 在不知道其模板参数的情况下将类模板声明为朋友的最佳方法
- r - 为什么ggplot以这种方式输出数据?
- python - 如何按行对具有多个条件的熊猫数据框列进行求和