gpt4 book ai didi

jquery - bootstrap jquery 弹出窗口大小

转载 作者:行者123 更新时间:2023-12-01 00:14:23 25 4
gpt4 key购买 nike

在我的带有 bootstrap 和 fullcalender 的应用程序中,弹出窗口的大小未正确显示。可以调整大小吗??我正在使用 Bootstrap 3。 enter image description here

代码

$(window).load(function() { 
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();

/* initialize the external events
-----------------------------------------------------------------*/

$('#external-events div.external-event').each(function() {

// create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)
// it doesn't need to have a start or end
var eventObject = {
title: $.trim($(this).text()) // use the element's text as the event title
};

// store the Event Object in the DOM element so we can get to it later
$(this).data('eventObject', eventObject);

// make the event draggable using jQuery UI
$(this).draggable({
zIndex: 999,
revert: true, // will cause the event to go back to its
revertDuration: 0 // original position after the drag
});

});



/* initialize the calendar
-----------------------------------------------------------------*/

$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
droppable: true, // this allows things to be dropped onto the calendar !!!
eventRender: function (event, element) {
element.popover({
title: "My Title",
placement:'auto',
html:true,
trigger : 'click',
animation : 'true',
content: event.msg
});
$('body').on('click', function (e) {
if (!element.is(e.target) && element.has(e.target).length === 0 && $('.popover').has(e.target).length === 0)
element.popover('hide');
});
},

events: [
{
title: 'All Day Event',
start: new Date(y, m, 1),
msg: 'I am OK',
},
{
title: 'Long Event',
start: new Date(y, m, d-5),
end: new Date(y, m, d-2),
msg: 'I am double OK',
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d-3, 16, 0),
allDay: false
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d+4, 16, 0),
allDay: false
},
{
title: 'Meeting',
start: new Date(y, m, d, 10, 30),
allDay: false
},
{
title: 'Lunch',
start: new Date(y, m, d, 12, 0),
end: new Date(y, m, d, 14, 0),
allDay: false
},
{
title: 'Birthday Party',
start: new Date(y, m, d+1, 19, 0),
end: new Date(y, m, d+1, 22, 30),
allDay: false
},
{
title: 'Click for Google',
start: new Date(y, m, 28),
end: new Date(y, m, 29),
url: 'http://google.com/'
}
]
});

});

JsFiddle http://jsfiddle.net/7gwz5/

最佳答案

找到了解决方案

刚刚添加了 {container:'body'} 到事件弹出窗口,效果很好

element.popover({
title: "My Title",
placement:'auto',
html:true,
trigger : 'click',
animation : 'true',
content: event.msg,
container:'body'
});

更新了 jslint http://jsfiddle.net/7gwz5/2/

关于jquery - bootstrap jquery 弹出窗口大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20117416/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com