add a fade in effect to main while scrolling up cover photo
This commit is contained in:
parent
22729da2a2
commit
c5d08fd5fd
@ -7,6 +7,7 @@ $(document).ready(function() {
|
||||
if($('#cover-photo').length && $(window).width() > 767) {
|
||||
$('.navbar-fixed-top').css('position', 'relative');
|
||||
$('main').css('padding-top', 0 + 'px');
|
||||
$('main').css('opacity', 0);
|
||||
}
|
||||
else {
|
||||
$('#cover-photo').remove();
|
||||
@ -71,4 +72,8 @@ $(window).scroll(function () {
|
||||
$('.navbar-fixed-top').css('position', 'fixed');
|
||||
$('#cover-photo').remove();
|
||||
}
|
||||
|
||||
if($('#cover-photo').length) {
|
||||
$('main').css('opacity', ($(window).scrollTop()/$('#cover-photo').height()).toFixed(1));
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user