2013-06-03 35 views
4

我试图(通过引导和引导,日期选择器扩展名),有一些问题,以显示在酥料饼的一个datepicker, 首先我有一个问题,显示日期选择器,发现这个话题:Datepicker in Popover Won't display ,但现在它显示我的酥料饼的背后,所以它不是完全可见引导日期选择器显示的是背后酥料饼

这里是HTML代码:

<button type="submit" class="btn btn-primary pop_doleance" rel="popover" data-original-title="Ajouter doléance">Ajouter doléance</button> 

<div style="display: none" class="pop_doleance_content"> 
<form class="well form-inline form_doleance"> 
    <label for="date">Date : </label> 
    <input id="date" type="text" class="input-medium"> 
</form> 

和JavaScript代码:

var tmp = $.fn.popover.Constructor.prototype.show; 
$.fn.popover.Constructor.prototype.show = function(){ 
    tmp.call(this); 
    if (this.options.callback) { 
    this.options.callback(); 
    } 
} 

$(function(){ 
    $(".pop_doleance").popover({ 
     placement:'bottom', 
     html : true, 
     content: function(){return $('.pop_doleance_content').html();}, 
     callback: function(){$('#date').datepicker();} 
    }); 
}); 

任何想法?

回答

7

将popup的z-index设置为较低的值。

.popup { z-index : 900; } 

和日期选择器的容器的z-index设定为较高的值就像在jQuery UI的日期选择器的情况下设置

.ui-datepicker-div { z-index: 999; } 
+0

所以,我想您的解决方案。 HTML:'


' CSS:'.pop_doleance {z-index:900; } .pop_doleance_content {z-index:933; } .form_doleance {z-index:966; } #divdate {z-index:999; }' 告诉我,如果我做错了 – Daft

+0

对不起,我第一次不明白你的意思,我不得不为扩展名的.datepicker类创建一个z-index。非常感谢 – Daft