Skip to content
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

Child divs removed before they have scrolled off the screen #9

Open
omundy opened this issue Feb 1, 2014 · 3 comments
Open

Child divs removed before they have scrolled off the screen #9

omundy opened this issue Feb 1, 2014 · 3 comments

Comments

@omundy
Copy link

omundy commented Feb 1, 2014

I have 9 child divs. Clicking a link in the pager, or the next/prev buttons, which would require a significant of amount of scrolling you can see the child div disappear before it has scrolled off the screen. I was going to fork and alter the code but succeeded only in breaking other things so I am reporting it here. Thanks.

@straydogstudio
Copy link
Owner

I've not had time to work on this. It is definitely an issue and it will have to be remedied. To do it right means the div's from one side need to be replicated to the other before the move, and then have the old dropped after the move. But this invalidates any references to the old div's. I have some code that attempts to find the nearest direction to an element in order to prevent just such an issue. It probably needs to be improved.

@bjornmeansbear
Copy link

what if you appended "before" divs and "after" divs that replicates all the starting divs on each "side" of the film strip?

Once a "before" or an "after" gets the "active" class assigned to it, animating of position would be disabled, the active class would then be toggled off the "after" or "before" to the first or last original div (if the first "after" div becomes active, then it's swapped with the first original div — the last "before" element switches to the last original element); re-center the slideshow on the original div without animating (since animation is turned off), then turn the animating back on once that change is complete so that the next "next" or "prev" click slides again…

I have no idea how to do this, but conceptually I think it would work

@straydogstudio
Copy link
Owner

I've tried a few solutions:

  • Duplicate all slides left/right. This has performance issues, as even though they are mostly hidden, the spends time on everything. Also, it breaks unique ids and any events placed on the child elements.
  • Temporarily create a duplicate during animation, removing it and rotating the children when the animation is finished. This works pretty well until you have someone clicking 3 or 4 times before the animation is done. Or, it really becomes a mess if someone (programatically) clicks left and right before the animation is done. Then it becomes a bookkeeping problem. My first attempt became overly complicated, and fixing one bug kept leading to others.

I still think the second solution is the way to go. I am waiting to rewrite the plugin to get a fresh start.

Also, in the meantime, it is very easy to manually duplicate the children when there are too few! Sometimes the manual solution is still the best! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants