patrickmarabeas / ng-ScrollSpy.js

An AngularJS module for navigation highlighting
http://patrickmarabeas.github.io/ng-ScrollSpy.js
MIT License
26 stars 9 forks source link

Invalid behaviour #10

Open EugeneFeshchenko opened 9 years ago

EugeneFeshchenko commented 9 years ago

After upgrade to v3.2.1 plugin does work. But does not work as expected. On my project it highlights wrong elements. Take a look at screenshot: screen

note position of scrollbar and that very last element is highlited and first one is not. I populate items dynamically, maybe this is issue. Code looks like that

<ul class="contest">
      <li ng-repeat="item in docs">
        <a ng-click="scrollTo('section'+item.id)" data-scrollspy-listen="section{{item.id}}">{{ item.title }}</a>
        <ul>
          <li ng-repeat="cont in item.doccontent_set">
            <a ng-click="scrollTo('topic'+cont.id)" data-scrollspy-listen="topic{{cont.id}}">{{ cont.title }}</a>
          </li>
        </ul>
      </li>
    </ul>

Also scrolling page doesn't help much. Any other item isn't activated, except the one 'Tutorial' on a more or less valid scroll position.

patrickmarabeas commented 9 years ago

If you could replicate the issue in a plnkr (/ fork demo) or similar, easily, that would be fantastic (eg try applying your dynamic creation to the ScrollSpy demo). I should be able to have a noodle over it in the next few days.