gfranko / jquery.tocify.js

A jQuery Table of Contents plugin that can be themed with Twitter Bootstrap or jQueryUI.
http://gregfranko.com/jquery.tocify.js/
MIT License
928 stars 216 forks source link

Item becomes active too early #88

Open pozitron57 opened 8 years ago

pozitron57 commented 8 years ago

Hi there,

First of all, thank you for tocify!

I have an issue: if one header is far from the other, the entry becomes active too early when you scroll down. You can see it on the test page. Just scroll down.

Is it intended behavior or I messed something up? I tried setting different values for highlightOffset with no luck.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

alexey-yanchenko commented 7 years ago

Grab _jquery.tocify.js from lord/slate repo, file contains a fix

jenlampton commented 5 years ago

@alexey-yanchenko the link to _jquery.tocify.js 404s. I'm also suffering from this bug, do you happen to know what the fix was? Or even, know what version of lord/slate your fix was in? It looks like version 1.4 almost lines up with date to your comment here. I'll start there.

I'd like to post a PR here so everyone can benefit from having this fix in TOC itself.

gfranko commented 5 years ago

I haven't had time to maintain this repository for the last few years, so if anyone would like a particular fix just send me a tip via Paypal and I'll look into it

jenlampton commented 5 years ago

Thanks @gfranko, it's a cool little lib, and thanks for all your work on it in the past! :)

jenlampton commented 5 years ago

Okay, I took version 1.4 of lord/slate and made a diff between _jquery.tocify.js and version 1.8 of jquery.tocify.js. I then applied that diff to the 1.9 version of jquery.tocify.js and created a pr: https://github.com/gfranko/jquery.tocify.js/pull/112

I'm not very good with JavaScript, so I didn't try to pick out only the changes that I thought were relevant to this issue, but I can confirm that the item becoming active too early is no longer an issue on my site.