CSS - Chrome - Apply gradual opacity to content when it scrolls up to the point where it disappears.

On this web page:

web page link

As the content page scrolls up, it disappears behind a <div>

before scrolling:
before disappear
during scrolling:
during scroll

My question is -- as the content approaches the area where it gets hidden, is there a way to have a gradual opacity div in place such that the content kind of begins to disappear gradually as it scrolls up?

Hope this makes sense.
LVL 5
Tom KnowltonWeb developerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MishaProgrammerCommented:
If you want to hide element gradually, you can use jquerry:
$("#button").click(function(){ 
          $("#divID").fadeOut(3000,0.001)
});

Open in new window


If you want hide elemnt in scroll, you can use relevant event:
$('#target').scroll(function() {
  $("#divID").fadeOut(3000,0.001)
});

Open in new window

0
Snarf0001Commented:
You can try putting a gradient background instead of a flat white on your h1 element.
 The h1 #sectionTitle that has "Jackpacks" on the linked page, instead of:

background-color:#fff;

use

background:linear-gradient(to bottom, rgba(255,255,255,1) 40%,rgba(255,255,255,0) 100%);

Sine the position is fixed, as you scroll the page, the content underneath will be hidden under the sliding transparency.
You can play with the height of the element and the 40% vs 100% to adjust the gradient.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tom KnowltonWeb developerAuthor Commented:
Excellent work.  Thanks to both of you!

Tom  :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.