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) {
|
if($('#cover-photo').length && $(window).width() > 767) {
|
||||||
$('.navbar-fixed-top').css('position', 'relative');
|
$('.navbar-fixed-top').css('position', 'relative');
|
||||||
$('main').css('padding-top', 0 + 'px');
|
$('main').css('padding-top', 0 + 'px');
|
||||||
|
$('main').css('opacity', 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('#cover-photo').remove();
|
$('#cover-photo').remove();
|
||||||
@ -71,4 +72,8 @@ $(window).scroll(function () {
|
|||||||
$('.navbar-fixed-top').css('position', 'fixed');
|
$('.navbar-fixed-top').css('position', 'fixed');
|
||||||
$('#cover-photo').remove();
|
$('#cover-photo').remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($('#cover-photo').length) {
|
||||||
|
$('main').css('opacity', ($(window).scrollTop()/$('#cover-photo').height()).toFixed(1));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user