-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read property 'top' of undefined #6
Comments
I'm getting the same error. The same code works on a simple html page, but I get the error when I use the code within a cms. I'm trying to get this to work in a Joomla module and the site is loading mootools so I'm guessing it's a conflict with that. |
In my case this turned out to be something with the window resize event handler. I had to remove resize here: https://github.com/tinywall/numscroller/blob/gh-pages/numscroller-1.0.js#L14 Then it worked. |
Removing the word 'scroll' from this line ' $(window).on("load scroll resize", function(){' works. But, why? |
I think the problem is that both the part that adds the div under the body tag and the part that checks for that div both fire at the same time (onload). I ran into this again after my first hack and I think it's down to the amount of js the cms is trying to load and the time before the events fire. I fixed it this time by adding the div under the body tag on document ready and then checking for it on document load. I'll add a pull request and if anyone with the issue can confirm the fix works, hopefully, it can be merged. @feichter @apair are you still using the script and able to test the updates? |
Related to issue tinywall#6
I came up with this problem and my solution is:1- I added the div as showen here under the body tag.
2- Then modified the js code to check if the ### div#scrollzipPoint is not loaded then add this div by js.the modifide code is showen hereoriginal code:======== Modified code:========
_I hope_that helpful for you |
Steps to reproduce ;
Expected Result
Actual Result
The text was updated successfully, but these errors were encountered: