Jquery 完整日历删除滚动条
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12429245/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Jquery Full Calendar Remove Scroll Bar
提问by D-W
I Have the jquery full calendar in use, but im trying to get rid of the scroll bar. Ive tried setting the height, does not work.
我正在使用 jquery 完整日历,但我试图摆脱滚动条。我试过设置高度,不起作用。
Anyone have a fix (that they have used!, no links- I've tried most of them)?
任何人都有修复程序(他们已经使用过!,没有链接 - 我已经尝试了大部分)?
I'm using:
我正在使用:
$('#calendar').fullCalendar({
firstDay: 1,
minTime:@Model.MinHour,
maxTime:@Model.MaxHour})
Page is big enough, just cant get the darn thing to go!
页面足够大,只是不能得到该死的东西去!
回答by Adam Maloney
I set height and contentHeight to the same value and it seems to have done the trick.
我将 height 和 contentHeight 设置为相同的值,它似乎已经成功了。
css:
css:
#calendar {
height:1000px;
}
js:
js:
var calHeight = 1000;
$('#calendar').fullCalendar({
height:calHeight,
contentHeight:calHeight
});
Edit:
编辑:
I found on refresh between views, caused it to show scroll when I don't want it to. Added this:
我在视图之间刷新时发现,导致它在我不想要的时候显示滚动。添加了这个:
.fc-scroller {
overflow-y: hidden !important;
}
回答by J.T. Houtenbos
As of version 2.1.0 height option can be set to 'auto'
从 2.1.0 版开始,高度选项可以设置为“自动”
https://fullcalendar.io/docs/display/height/
https://fullcalendar.io/docs/display/height/
This will remove the vertical scrollbar
这将删除垂直滚动条
回答by Naveen dev
Try this https://fullcalendar.io/docs/contentHeightcontentHeight:"auto", is used for remove scroll bar
试试这个https://fullcalendar.io/docs/contentHeightcontentHeight:"auto",用于移除滚动条
<script>
jQuery('#calendar').fullCalendar({
header: {
left: 'prev',
center: 'title',
right: 'next'
},
defaultView: 'month',
showNonCurrentDates:false,
fixedWeekCount:false,
contentHeight:"auto",
handleWindowResize:true,
themeSystem:'bootstrap3',
});
</script>
回答by vinay mittal
Although its documentation says that auto
option given for heightand contentHeightworks but only for versions above 2.1.0
.
尽管其文档说auto
为height和contentHeight 提供的选项有效,但仅适用于以上版本2.1.0
。
This code worked for me for any version:
此代码适用于任何版本:
.fc-scroller {
height: auto !important;
}
回答by Koala7
Crete a div containing your calendar and then put in the css overflow-y:hidden;overflow-y:hidden;
克里特岛包含您的日历的 div,然后放入 css overflow-y:hidden;overflow-y:hidden;
div class="container-calendar"
.container-calendar {
overflow-x:hidden;
overflow-y:hidden;
}
回答by Maria
In fullcalendar version 2.7.1 this can be fixed commenting the lines with the call to the function that sets the overflows:
在 fullcalendar 版本 2.7.1 中,这可以通过对设置溢出的函数的调用来修复注释行:
this.applyOverflow();
There are 2 functions calling this function: clear (around line 8855) and render (around line 8843)
有 2 个函数调用此函数:clear(约 8855 行)和 render(约 8843 行)
回答by Harshana Lasith
$('.fullCalendar').fullCalendar({
aspectRatio: 1.605, -> this works for me
回答by D-W
I ended up using the a later version which solved the bug
我最终使用了解决该错误的更高版本
回答by Edmond Chui
You can try expanding the width of the calender to make the scrollbar out of the right side of the viewport, and then set overflow-x: hidden for the containing element.
您可以尝试扩大日历的宽度,使滚动条脱离视口右侧,然后为包含元素设置 overflow-x: hidden。
回答by K-Alex
Try this:
尝试这个:
$(document).ready(function () {
$('#calendar').fullCalendar({
height: 300,
contentHeight: 360,
});
});
These 300 and 360 are an example, You can set them to whatever you'd like while the idea remains the same ..
这些 300 和 360 是一个例子,您可以将它们设置为您想要的任何内容,而想法保持不变..