-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding new option #42
base: master
Are you sure you want to change the base?
Adding new option #42
Conversation
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.
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 |
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 |
Commenting test which won't work on PhantomJS Updating logic since it was grabbing an incorrect element. Padding is now being changed when needed and calculating increments so we don't see any jumps.
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 |
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