【发布时间】:2019-04-19 06:53:36
【问题描述】:
我已经在表 td 的点击事件上制作了时间选择器,因此用户可以在点击 td 时间选择器显示时更改时间,更改时间后数据将使用 ajax 保存,时间选择器再次隐藏并正常显示 td。
在 td timepicker 的那个 onclick 事件中显示,但我不能在这个 timepicker 上设置 onchange 事件或 onfocus out 事件
$(".starttime_text").click(function(){
$(this).css("display", "none");
$(this).siblings(".starttime_dd").css("display", "block");
})
$(function () {
$(".starttime").timepicker();
$('.starttime').on('changeTime', function() {
var val = $('.starttime').text($(this).val());
console.log($(this).val());
});
});
<td id="" class="td_text">
<span class="starttime_text" id=""><?php echo date('h:i',strtotime($['date'])) ?></span>
<span class="starttime_dd" style="display:none;">
<div class="input-group bootstrap-timepicker timepicker">
<input type="text" class="form-control input-small starttime" size="35" value="<?php echo date('h:i',strtotime($customer['date'])); ?>">
<span class="input-group-addon"><i class="glyphicon glyphicon-time"></i></span>
</div>
</span>
</td>
谁能帮帮我...
【问题讨论】:
标签: jquery html timepicker jquery-focusout