peachananr / purejs-onepage-scroll

The javascript version of the infamous jQuery One Page Scroll without relying on jQuery.
http://peachananr.github.io/purejs-onepage-scroll/demo/purejs_onepage_scroll_demo.html
GNU General Public License v2.0
770 stars 182 forks source link

'active' class not found.. #11

Closed TrySpace closed 5 months ago

TrySpace commented 9 years ago

I'm trying this plugin with React. now it seems that the 'active' class that onepagescroll writes, gets overwritten. So when I scroll:

 Uncaught TypeError: Cannot read property 'dataset' of null  - onepagescroll.js:384 
     moveDown onepagescroll.js:363 
      _init_scrollonepagescroll.js:130
      init._mouseWheelHandler

I don't know when the beforeMove is being called, but it's after that error. If it were before, then I could maybe set the active class myself.

It would be nice if there was another method like updatedScroll that returns some object like:

{   
  pageTotal: 3, 
  currentPageIndex: 1,  // the page you're currently on ( array key )
}

That should be basically all I need to make sure the right element has an active class. Unless there's other stuff the plugin needs to function properly?

TrySpace commented 5 months ago

Closing because nobody cares.