joehewitt / scrollability

Imitates iOS native scrolling in JavaScript.
http://joehewitt.github.com/scrollability
Other
1.78k stars 147 forks source link

two issues and one question #29

Open heatxsink opened 12 years ago

heatxsink commented 12 years ago

here we go ...

issues

  1. looks like all of the examples are pointing to scrollability.min.js which isn't even checked in. (my way around this is to download the scrollability.min.js file from your example site however it's minified so i can't find the unminified version of that js anywhere. :-/
  2. scrollability.js in master has two bugs in it based around the 'export' and 'require' variables don't exist. this kind of defeats "the whole drop in this script and stuff just works" paradigm

    question

in an older version of scrollability there was a method to scrollToTop. how would one do that now?

thanks, nick

youngpip commented 12 years ago

I have the same issues and question. any thoughts joe?

yourfavorite commented 12 years ago

You can get the code working but as it stands it looks like there are two variable that aren't defined. "exports" and "require"

To get the code running just comment out or remove all of the exports stuff (lines 77-84). Then on line 94 where require is mentioned, just pull the two lines of code out of that ready function and comment the ready function out. After doing this your code will run. I'm not sure what the deal is with the exports and require function but I assume we're missing some code for that stuff.

heatxsink commented 12 years ago

after some poking around it looks like the repo is/was built for node.js (via npm) hence "exports" and "require"?

yourfavorite commented 12 years ago

Yeah I found the same thing just after posting.

youngpip commented 12 years ago

Great stuff, that's worked for me too.

Any idea on how to replicate the old scrollToTop function though? Without that I'm pretty stuck.

heatxsink commented 12 years ago

ah maybe it's CommonJS format and not npm? anyone?