It's probably something in this line that you need:
$(/* elemento desejado, ou simplesmente window */).bind('scroll', function() {
if ($(window).scrollTop() >= 1110) {
$("#parte3").css("display", "block");
} else { // use o else se quiser reverter ao subir.
$("#parte3").css("display", "none"); // aqui ponha o display original.
}
});
If you are talking about display:none
, switch to opacity
with animate
(or fadeTo, which is the simple way of jQuery). EDIT: As well remembered by @Sergio , if it is to show 100%, just use .fadeIn()
.
$(window).bind('scroll', function() {
if ($(window).scrollTop() >= 1110) {
$( "#parte3" ).fadeTo( 500, .5 ); // velocidade, transparência
} ...
In this case, do not use display:none
initially, but opacity: 0
.
And if you want a timer before the effect, you have .delay()
:
$(window).bind('scroll', function() {
if ($(window).scrollTop() >= 1110) {
$( "#parte3" ).delay( 500 ).fadeIn( 500 );
} ...