You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is something i do not like about the strictly positioned parameters, they feel a bit old-school and sluggish, and way to strict. I would like a looser approach.
I was thinking about this yesterday, what do you guys think? Instead of having the scroll offset as the first parameter, being ambiguous and all, like so: <div data-scroll="150 animateIn animateOut once"></div>
How about something more clear, like so: <div data-scroll="animateIn animateOut offset(0,150) once"></div>
That way it is not strict to the first parameter, and we can use it for x as well as the y position. So now the only 2 strictly positioned parameters are the animateIn and animateOut classes. We can also eliminate those with something like this: <div data-scroll="in(.animateIn) out(.animateOut) offset(0,150) once addHeight"></div>
That way the code is way more legible, adding the dot before the animateIn and animateOut classes hints the user that its a CSS class.
Another approach would be to use a single parameter for the animateIn and out classes, like so: <div data-scroll="toggle(.animateIn, .animateOut) offset(0,150) once addHeight"></div>
What would you guys prefer?
The text was updated successfully, but these errors were encountered:
Alright, yeah for v0.2 i have chosen for data-scroll-showCallback and data-scroll-hideCallback. The callback needs to be in the global window scope, it avoids using eval.
The syntax i've chosen for v0.2 is the last one i mentioned in the post, using toggle() and offset() to pass those parameters.
There is something i do not like about the strictly positioned parameters, they feel a bit old-school and sluggish, and way to strict. I would like a looser approach.
I was thinking about this yesterday, what do you guys think? Instead of having the scroll offset as the first parameter, being ambiguous and all, like so:
<div data-scroll="150 animateIn animateOut once"></div>
How about something more clear, like so:
<div data-scroll="animateIn animateOut offset(0,150) once"></div>
That way it is not strict to the first parameter, and we can use it for x as well as the y position. So now the only 2 strictly positioned parameters are the animateIn and animateOut classes. We can also eliminate those with something like this:
<div data-scroll="in(.animateIn) out(.animateOut) offset(0,150) once addHeight"></div>
That way the code is way more legible, adding the dot before the animateIn and animateOut classes hints the user that its a CSS class.
Another approach would be to use a single parameter for the animateIn and out classes, like so:
<div data-scroll="toggle(.animateIn, .animateOut) offset(0,150) once addHeight"></div>
What would you guys prefer?
The text was updated successfully, but these errors were encountered: