How to make this feature animated?
$(function() { $(window).scroll(function() { if($(window).scrollTop() > 100) { $(".header").css({ width: "100%", position: "fixed" }) } else { $(".header").css({ width: "auto", position: "relative" }) } }); }); How to make this feature animated?
$(function() { $(window).scroll(function() { if($(window).scrollTop() > 100) { $(".header").css({ width: "100%", position: "fixed" }) } else { $(".header").css({ width: "auto", position: "relative" }) } }); }); It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:
$(function() { $(window).scroll(function() { if($(window).scrollTop() > 100) { $(".header").animate({ width: "100%", position: "fixed" },5000); } else { $(".header").animate({ width: "auto", position: "relative" },5000); } }); }); ,5000 where you want? ;) - Dmitriy SimushevSource: https://ru.stackoverflow.com/questions/473711/
All Articles