sticky-kit icon indicating copy to clipboard operation
sticky-kit copied to clipboard

change offset_top dinamyc

Open d-kochanzhi opened this issue 8 years ago • 2 comments

I added a feature to change the offset top, when we need to show two or more sticky elements in page one under another.

refresh = function (event, opts) {
         if (opts == null) {
            opts = { };
        }       
         if (opts.offset_top != null && offset_top !== opts.offset_top) {
            offset_top = opts.offset_top;
            recalc_and_tick();
        }

      };

elm.on("sticky_kit:refresh", refresh);

using

 .on('sticky_kit:stick', function (e) {
       $("#element").trigger('sticky_kit:refresh', [{ offset_top: fixTop }]);          
 });

very usefull, can you add it to origin script?

d-kochanzhi avatar Aug 24 '16 09:08 d-kochanzhi

Why not create a pull request?

jimmyko avatar Jul 17 '17 19:07 jimmyko

Hello there Is this featured added in last version yet?

steve231293 avatar Oct 04 '21 09:10 steve231293