ui jquery datepicker不会显示向下

ui jquery datepicker不会显示向下

问题描述:

我的日期选择器不会弹出下面,它总是向上打开,我不知道为什么,因为在ui jQuery演示中,日期选择器向下打开。ui jquery datepicker不会显示向下

<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"> 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> 
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> 

<script> 
$(document).ready(function() { 
    orientation: "top auto" 
$(".datepicker").datepicker(); 
}); 
</script> 
<div id="div4"> 
<p>What date do you wanna get outta here?</p> 
<input class = "datepicker" name = "outboundDate" /><br> 
</div> 
+0

代码很好,在这里测试它:https://plnkr.co/edit/TDc8m45q4Wna1byMeoN7?p=preview – deblocker

+0

谢谢,是的,当我尝试在另一个文件上的代码,它的工作原理,但由于某种原因,它在我正在处理的文件上向上打开,我不知道为什么 –

+0

@deblocker你确定吗?第3行警报。 – Twisty

欢迎来到Stack Overflow。

您的语法看起来不正确。我相信你应该使用:

$(document).ready(function() { 
    $(".datepicker").datepicker({ 
    orientation: "top auto" 
    }); 
}); 

检查您的JS控制台的任何其他警报或错误报告。