日期选取器定位工作不正常
Datepicker positioning not correctly working
我有一个搜索框,它搜索一个时间段内的日期范围,用户可以使用 jquery 中的日期选择器插件选择这些日期。我遇到的问题是启用日期选择器的位置出现在页面的左下角,而不是直接在搜索框下方。我已经提供了用于jquery和HTML部分的标记。谁能告诉我如何纠正这一点?
j查询:
<script type="text/javascript" src="includes/javascript/daterangepicker.jQuery.js"></script>
<script type="text/javascript">
$(function(){
if($(window.parent.document).find('iframe').size()){
var inframe = true;
}
$('.datepick').daterangepicker({
arrows: false,
dateFormat: 'dd/mm/yy',
posX: null,
posY: null,
onOpen:function(){
if(inframe){
$(window.parent.document).find('iframe:eq(0)').width(700).height('35em');
}
},
onClose: function(){
if(inframe){
$(window.parent.document).find('iframe:eq(0)').width('100%').height('5em');
}
}
});
});
</script>
.HTML:
<table border="0" align="right">
<tr>
<?php echo tep_draw_form('search_date_purchased', FILENAME_ORDERS, '', 'post'); ?>
<td class="smallText" align="right">
<?php echo TEXT_ORDER_DATE;?>
<input type="text" name="search_date_purchased" placeholder="Choose a Date" class="datepick" value="<?php echo $HTTP_POST_VARS['search_date_purchased'];?>">
<input src="./images/Search.png" alt="Search" title="Search" border="0" type="image">
</td>
</form>
</tr>
</table>
您的 html 无效:您的 html 中有一个结束表单标记。此外,您尝试在tr标签中回显某些内容,这不是vallid html。您需要在 TD 标签内回显。
<table border="0" align="right">
<tr>
<td><?php echo tep_draw_form('search_date_purchased', FILENAME_ORDERS, '', 'post'); ?></td>
<td class="smallText" align="right"><?php echo TEXT_ORDER_DATE;?> <input type="text" name="search_date_purchased" placeholder="Choose a Date" class="datepick" value="<?php echo $HTTP_POST_VARS['search_date_purchased'];?>"> <input src="./images/Search.png" alt="Search" title="Search" border="0" type="image"></td>
</tr>
</table>
相关文章:
- Javascript.getHours()工作不正常
- removeClass函数没有'工作不正常
- jQuery Ajax GET请求工作不正常
- Cordova ng路线工作不正常
- 更新属性工作不正常Meteor/MongoDB
- 为什么文本对齐:对;工作不正常
- Javascript作用域和Ajax调用;工作不正常
- JavaScript DOM insertBefore'工作不正常
- Angular Js布线工作不正常
- onmouseout函数工作不正常
- 承诺工作不正常
- JQuery.live()工作不正常
- Alloy UI文本区域工作不正常
- ng src工作不正常,但src工作正常
- Canvas.toDataUrl(“image/png”)工作不正常
- JQuery `length`属性工作不正常.为什么?
- Javascript setInterval工作不正常
- 我的Javascript代码没有'工作不正常
- 表单验证工作不正常,在不检查条目的情况下继续
- $localStorage array select with ng选项工作不正常