Open Antonio-Laguna opened 10 years ago
I wonder if we should just default the value to 'body'. I guess that might break some sites if we add padding to the bottom of the body. thoughts?
I thought the same but maybe we can just use true if the option is set to true
in which case it's up to the developer to leave that as is.
so true will add padding to body?
Yep, that's my suggestion but that's not what's implemented. Should I proceed?
lets leave it as false for now and then we can always change later
every time I click on a link, the bottom padding grows.
found another issue. In the example, if I click the last item and then click the second to last, the smooth scrolling is a little off. Not sure the best way to handle this. Also, can you merge in from master?
make sure you remove the margin-bottom: 1000px and add the addBottomPadding to the plugin in the example
This should now be fixed. I made removing the padding
in the case it's less than the previous one an operation to be done after scrolling so you don't notice a jumpiness.
Adding new option to TOC (
addBottomPadding
) which receives a jQuery selector. When an element is clicked, TOC will check wether there is enough space on the document / window for the target to be positioned at the top of the screen. If there is not, it will add the padding it needs to do it.Fixes #38