我正在尝试设置bootstrap datepicker并且它没有加载。我在jsfiddle上设置了一个演示:https://jsfiddle.net/950g0oku/6/
输入字段是
<input id="id_dates-0-starts" class="datepicker field_required" type="text" name="dates-0-starts">
和javascript
$(".datepicker").datepicker();
我希望当我点击日历应该显示的框时。从这里使用bootstrap datepicker https://bootstrap-datepicker.readthedocs.org/en/latest/
答案 0 :(得分:2)
如果要使用bootstrap-datepicker,则必须包含库本身。我已经更新了您的示例,因此它可以正常工作!
您缺少这些库文件:
if(((eleB.top >= eleA.top && eleB.top <= eleA.bottom) || (eleB.bottom >= eleA.top && eleB.bottom <= eleA.bottom)) && ((eleB.left >= eleA.left && eleB.left <= eleA.right) || (eleB.right >= eleA.left && eleB.right <= eleA.right))) {
el1.innerHTML = '<p>covered</p>'; // or your code of adding true to the attribute that tells about overlapping
}
else {
el1.innerHTML = '<p>not covered</p>';
}