jimmynotjim / scrollnav

A dependency free JavaScript plugin for auto generating single page navigation
http://scrollnav.com
MIT License
461 stars 127 forks source link

Wrong active item using reset.css #64

Closed jdmoliner closed 6 years ago

jdmoliner commented 9 years ago

Hi,

I use 'reset.css', then a 0 margin is applied to 'h2' and 'p'. Also I have a decoration below H2 called 'dotted-5'. Under these conditions I get wrong active item.

I made this example:

http://jsfiddle.net/kurtko/65je5n9v/

Thanks

jimmynotjim commented 9 years ago

@jdmoliner really sorry I didn't see this. I don't think this is an issue with reset.css because I've used that as well and it should calculate the exact positioning of the <section> that it wraps each chunk in. I think it actually looks like another bug that I thought I had fixed already, but I'll have to play with it this weekend to be sure.

jdmoliner commented 9 years ago

You can see in my example if you remove the next line works fine:

p , h2 {margin:0;padding:0}

jimmynotjim commented 6 years ago

Re-reviewing this and your jsfiddle seems to highlight the correct section. Luckily, the entire plugin is being rewritten to avoid inserting sections to the main content and should resolve any of these issues. Closing in favor of tracking in #86