【发布时间】:2014-10-29 22:43:22
【问题描述】:
请向下滚动我的小提琴。我在底部有一个额外的空白,我不知道如何删除。 如果我通过单击 NEXT 向下滚动,则布局很好。 任何帮助都非常感谢
jS:
var lines = function () {
$('div.section').css('height', $(window).height() + 'px');
}
lines();
$(window).resize(function () {
lines();
heightsCalculator();
});
heightsCalculator();
function heightsCalculator() {
var windowHeight = ($(window).height()),
heightDocument = (windowHeight) + ($('#one').height()) + ($('#two').height()) + ($('#three').height()) + ($('#four').height()) + ($('#five').height());
$('#scroll-animate, #scroll-animate-main').css({
'height': heightDocument + 'px'
});
window.onscroll = function () {
var scroll = window.scrollY;
$('#scroll-animate-main').css({
'top': '-' + scroll + 'px'
});
$('#one').css({
'background-position-y': 0 - (scroll * 100 / heightDocument) + '%'
});
}
}
【问题讨论】:
标签: javascript jquery html css height