Search code examples
jqueryhtmlcsssticky

how to add smooth animation in fixed header


i searched a lot for adding smooth sticky header for this particular code..nothing works for me

anyone, please add animation for this coding..

(function ($) {
    "use strict";
    $("#header").affix({
        offset: {
            top: 100
        , bottom: function () {
            return (this.bottom = $('#copy').outerHeight(true))
        }
        }
    })
})(jQuery);

Thanks in advance.


Solution

  • use css

    #header{
      transition-duration : 2s;
    }
    

    hope it help