0
I have a div .menuFixo
, that when it reaches 31px scroll she stay with top: 0
, otherwise, stay top:31px
, I did with Jquery, but it didn’t work.
$(window).scroll(function () {
if ($(window).scrollTop() > 31) {
$(".menuFixo").css("top", "0");
};
else if ($(window).scrollTop() < 31) {
$(".menuFixo").css("top", "31px");
};
});
I don’t think you need the second
if
, onlyelse
– Franchesco
I tried with only
else
and it didn’t work– Felipe Viero Goulart
@Felipe Stoker Try to put one
Alert
to see if this calling function.– Jothaz
I couldn’t figure out what it was, finally I did what I wanted otherwise.
– Felipe Viero Goulart