とにかく、スクロールする緑の div をページの上にスクロールするのではなく、黒いナビゲーションをページの上に押し上げることができますか?
これが私の例です。ページを下にスクロールすると、バナーがフェードしてスクロールします。
Jquery が追加されました:
jQuery(function($) {
function scrollBanner() {
//Get the scoll position of the page
scrollPos = jQuery(this).scrollTop();
//Scroll and fade out the banner text
jQuery('.hero-unit').css({
'margin-top' : -(scrollPos/3)+"px",
'opacity' : 1-(scrollPos/300)
});
//Scroll the background of the banner
jQuery('.fade').css({
'background-position' : 'center ' + (-scrollPos/8)+"px"
});
}
jQuery(window).scroll(function() {
scrollBanner();
});`
このサイトと同じ効果が欲しい: