joelmukuthu / angular-snapscroll

Vertical scroll-and-snap functionality in angular
http://joelmukuthu.github.io/angular-snapscroll/
MIT License
56 stars 18 forks source link

Scroll working on firefox but not working on chrome (Windows) #35

Closed cambardekar closed 8 years ago

cambardekar commented 8 years ago

Hello, On firefox, scroll is working very fine. But when I open the same in google chrome, it is showing following error:

Uncaught TypeError: Cannot read property '0' of undefined snap @ angular-snapscroll.js:422 snapDown @ angular-snapscroll.js:450 down @ angular-snapscroll.js:463 bindWheel @ angular-wheelie.js:42 dispatch @ jquery-3.1.0.js:5110 elemData.handle @ jquery-3.1.0.js:4918

The Framework I am using: AngularJS with Angular Routing, dJango Templating

I am not able to figure it out why only chrome is showing such error. Please help me out with the same. Thank you.

joelmukuthu commented 8 years ago

Hi! That's quite weird indeed, it works for me testing on Chrome 53 on Windows 10. Does the error occur just when you open the page or when you try to scroll afterwards? Can you paste some HTML code that shows how you're using snapscroll?

cambardekar commented 8 years ago

Hi, There is no error when I am landing on the page. But as soon as I scroll the mouse-wheel, it starts throwing the error mentioned above. I can paste here the html code of the partial page not total website as I am using angular routes. So, it might not much helpful for debugging. But surely, we can paste it in default html frame.

I am trying to paste code here. but unfortunately I am unable to paste complete code as it is compiled by github panel. So, we'll need to sort it out in some other way.

But the error is coming up as soon as scroll is triggered. Awaiting for the solution asap. Thank you.

joelmukuthu commented 8 years ago

I'm afraid I can't reliably tell what's going on from the html you sent.

There seems to be a lot of scroll related stuff (scrollspy, parallax) going on on the page, I would recommend that you try a minimal example and see if it works on both browsers and then build up from there. I would remove all of the scroll related plugins and then add them back (while testing after each addition) in this order: snapscroll, scrollspy, parallax...

If you have the page online somewhere then I might be of more help in fixing this issue.

jernejc commented 7 years ago

Had the same issue, as soon as I added "snap-index" param it went away.

joelmukuthu commented 7 years ago

I'm still not able to reproduce this :/ @jernejc would it be possible for you to set up a pen/fiddle where i can see this?

jernejc commented 7 years ago

I can't seem to re-create this in a fiddle or in my original setup, but I did a lot of changes to that since then. There seems to be an edge case where it can't figure out the current index if snap-index param is not set.

I will try again over the weekend and let you know if I manage to re-create. Adding the param definitely solved the problem though.

joelmukuthu commented 7 years ago

Thanks Jernej, much appreciated :)