Removed JQuery dependency#380
Removed JQuery dependency#380cyruscook wants to merge 46 commits intolukehaas:masterfrom cyruscook:master
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
geekymemo
left a comment
There was a problem hiding this comment.
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.