1
我有fullcalendar的工作。但我有一个侧边栏用户可以折叠这个,然后内容框变得更大,但是当用户这样做时,日历并不像以前那么好。jQuery fullcalendar div大日历不舒展
所以我想到了窗口调整大小的功能,但这只适用于浏览器窗口更改,以便如何使fullcalendar在容器变得更大或更小时作出反应?
的JS以显示日历:
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
header: {
left: 'prev,next',
center: 'title',
right: 'month,basicWeek,basicDay'
},
editable: true
});
类侧边栏隐藏和显示按钮是.hide-BTN
的JS的显示和隐藏侧边栏:
$(".hide-btn").click(function(){
if($("#left").css("width") == "0px"){
$("#left").animate({width:"230px"}, 500);
$("#right").animate({marginLeft:"230px"}, 500);
$("#wrapper, #container").animate({backgroundPosition:"0 0"}, 500);
$(".hide-btn.top, .hide-btn.center, .hide-btn.bottom").animate({left:"223px"}, 500);
}
else{
$("#left").animate({width:"0px"}, 500);
$("#right").animate({marginLeft:"0px"}, 500);
$("#wrapper, #container").animate({backgroundPosition:"-230px 0px"}, 500);
$(".hide-btn.top, .hide-btn.center, .hide-btn.bottom").animate({left:"-7px"}, 500);
}
});
以下是屏幕截图:
thnx帮助我。但我不是职业javascripter zo我怎么能在我的代码中实现这个?因为当我将你的线添加到我的js时,没有任何事情发生。 – Maanstraat 2012-02-14 12:59:27
嗨,我认为问题可能是您需要在动画完成后运行该行,我已经编辑了包含该答案的答案。我确信这种方法可行,我在我自己的项目中使用它。 – 2012-02-15 22:27:46
是啊!这就是你坦克! – Maanstraat 2012-02-16 08:40:38