1
I’d like to hide one div
when another appeared on the screen.
The div I intend to hide has position: fixed
, In other words, the scroll accompanies the page, however, the footer has a similar part to that div and I would like to hide the fixed div when the other one is in sight. I tried the following code but no effect.
CODE
$(window).on('scroll', function() {
if($('#footer').is(":visible")) {
$(".socials").fadeOut("fast");
}else{
$(".socials").fadeIn("fast");
}
});
It wouldn’t work to call a method that hides your div and shows the other when you make the other visible?
– M. Bertolazo
@M.Bertolazo How so?
– I_like_trains
already give an example.
– M. Bertolazo
@M.Bertolazo These are not methods that they control, apparently. " Appearing on the screen, "as quoted in the question, refers to the fact that you scroll the page until a certain element in the footer is in the visible area of the page.
– Woss
@Andersoncarloswoss Yes, I got it. Thanks for the explanation, I’ll delete the answer.
– M. Bertolazo