2
Click problem not being blocked by gradient can be solved in some browsers with CSS:
pointer-events: none
however, to make a version quite compatible, you may need some JS per warranty if you want to support IE less than 11, and other browsers a little more "old".
I made an example in red, just to facilitate visualization and testing. I put links to facilitate the click test:
#lista {
position:relative;
}
#grad {
pointer-events: none; /* isto faz com que o clique "passe" adiante */
min-height:60px; /* Aqui voce define o tamanho do degrade */
width:100%;
position:absolute;
bottom:0;
/* Para branco, use 255,255,255,0 e 255,255,255,1 */
background: -moz-linear-gradient(top, rgba(255,0,0,0) 0%, rgba(255,0,0,1) 100%);
background: -webkit-linear-gradient(top, rgba(255,0,0,1) 0%,rgba(255,0,0,1) 100%);
background: linear-gradient(to bottom, rgba(255,0,0,0) 0%,rgba(255,0,0,1) 100%);
/* Para branco, use #00ffffff e #ffffff abaixo */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ff0000', endColorstr='#ff0000',GradientType=0 );
}
<div id="lista">
<div id="grad"></div>
<a href="#">Um</a><br>
<a href="#">Dois</a><br>
<a href="#">Tres</a><br>
<a href="#">Quatro</a><br>
<a href="#">Cinco </a><br>
</div>
Veja que o clique funciona mesmo nos últimos ítens.
You can create a div with "transparent white" gradient to "solid white" - You have several generators online like this one: http://www.colorzilla.com/gradient-editor/
– Bacco
Possible duplicate of How to let the bottom of the page degrade with Javascript?
– Randrade
@Dorivalzanetto I signalled only pq a @Bacco’s own response answers this question. Although the title has Javascript, the question has a css answer.
– Randrade