off by one pixel
This commit is contained in:
parent
f1fbcd7c02
commit
a81da0ec34
@ -11,7 +11,7 @@
|
|||||||
$(document).on('click', slideUpCover);
|
$(document).on('click', slideUpCover);
|
||||||
|
|
||||||
if($('#cover-photo').length && $(window).width() > 755) {
|
if($('#cover-photo').length && $(window).width() > 755) {
|
||||||
if($(window).scrollTop() <= $('#cover-photo').height()) {
|
if($(window).scrollTop() < $('#cover-photo').height()) {
|
||||||
$('main').css('margin-top', - $('nav').outerHeight(true) + 'px');
|
$('main').css('margin-top', - $('nav').outerHeight(true) + 'px');
|
||||||
$('aside').css('padding-top', aside_padding_top - $('nav').outerHeight() + 'px');
|
$('aside').css('padding-top', aside_padding_top - $('nav').outerHeight() + 'px');
|
||||||
$('section').css('padding-top', section_padding_top - $('nav').outerHeight() + 'px');
|
$('section').css('padding-top', section_padding_top - $('nav').outerHeight() + 'px');
|
||||||
@ -36,13 +36,13 @@
|
|||||||
$('main').css('margin-top', '');
|
$('main').css('margin-top', '');
|
||||||
coverSlid = true;
|
coverSlid = true;
|
||||||
}
|
}
|
||||||
else if ($('#cover-photo').length && $(window).width() > 755 && $(window).scrollTop() <= $('#cover-photo').height()){
|
else if ($('#cover-photo').length && $(window).width() > 755 && $(window).scrollTop() < $('#cover-photo').height()){
|
||||||
if(coverSlid) {
|
if(coverSlid) {
|
||||||
$(window).scrollTop(Math.ceil($('#cover-photo').height()));
|
$(window).scrollTop(Math.ceil($('#cover-photo').height()));
|
||||||
setTimeout(function(){ coverSlid = false; }, 1000);
|
setTimeout(function(){ coverSlid = false; }, 1000);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if($(window).scrollTop() <= $('#cover-photo').height()) {
|
if($(window).scrollTop() < $('#cover-photo').height()) {
|
||||||
$('main').css('margin-top', - $('nav').outerHeight(true) + 'px');
|
$('main').css('margin-top', - $('nav').outerHeight(true) + 'px');
|
||||||
$('aside').css('padding-top', aside_padding_top - $('nav').outerHeight() + 'px');
|
$('aside').css('padding-top', aside_padding_top - $('nav').outerHeight() + 'px');
|
||||||
$('section').css('padding-top', section_padding_top - $('nav').outerHeight() + 'px');
|
$('section').css('padding-top', section_padding_top - $('nav').outerHeight() + 'px');
|
||||||
|
Reference in New Issue
Block a user