-
Notifications
You must be signed in to change notification settings - Fork 574
Removed JQuery dependency #380
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
base: master
Are you sure you want to change the base?
Conversation
Replaced it with document.querySelectorAll
This is an amazing contribution, thank you. |
One thing to note, as you're using modern JavaScript, we'll need to introduce Babel to transpile this for older browser support. |
Ah, ok, hadn't been thinking about that. Would that involve a development file and a production file? I guess that would also mean that we could compress the production file which would be beneficial. I've given you access to my fork btw if that helps (https://github.com/cyruscook/Scrollify/invitations) |
I believe line 917 ( |
Regarding But I don' think I ever documented this so it's probably not used like that by anyone. |
…ll stick to this format in the future.
I've compressed the file and run it through babel. I've fixed a lot of things, but I've added a |
I'm having some trouble currently, could you help me? When offset is called on page load, it returns incorrect values, which is why the page snaps. If you check the array heights, its been populated with these incorrect heights. For some reason though, it seems that running the function again makes it work - I'm guessing if this is a problem with the page not fully loading yet? |
@cyruscook I'll take a look into that |
A few tweaks to tidy up
add a cross-browser offset function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi,
.height() is jquery method for js must be .offsetHeight
if (Math.floor(elements[index].offsetHeight / portHeight) > interstitialIndex) {
I wanted to use this on a website I'm building that doesn't have JQuery, so I rewrote the plugin to use vanilla JS.
It's seems to be working fine, and I'm implementing it into my own project right now, however I wondered if you'd like to include my changes in the base repo? There's practically no reason to use JQuery as it takes 100ms to load (on my computer) and nearly everything is achievable without it.
If you do want to use my code, please tell me as I will have to make some changes.
{
on a new line, however I can revert that too.