Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Sticky Kit jQuery plugin, but can't figure out how to use the 'offset_top' option?

Has anyone had any experience using the excellent Sticky Kit jQuery plugin? http://leafo.net/sticky-kit/

I can't figure out how to use the 'offset_top' option? The documentation for the options is a bit vague, the example shown is below:

$("#sticky_item").stick_in_parent(options)

I guess I have to write something like this:

$("#sticky_item").stick_in_parent(offset_top)

But how do I specify the number of pixels I want to offset #sticky_item by?

Any help would be greatly appreciated!

like image 823
StephenMeehan Avatar asked Oct 06 '13 17:10

StephenMeehan


1 Answers

Ah, figured it out.

To add a 20 pixel offset to #sticky_item do this:

$("#primary").stick_in_parent({offset_top: 20});
like image 68
StephenMeehan Avatar answered Oct 23 '22 19:10

StephenMeehan