-
Notifications
You must be signed in to change notification settings - Fork 75
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
prev method only works for first item #19
Comments
Thanks for this also and also for the great detail provided. Will look to address this one too this week. I will update shortly. Thanks! |
Hi @rshimshock Further to my comments in #18 There is an HTML test page in this repository which creates some test tickers and has controls for animation along with prev/next link buttons. When I test the prev/next everything looks good and works as expected (as designed). This control doesn't support different directional scrolling but it should let you go prev/back as expected. If you are seeing different results to that when using the control as designed then please re-open this issue. Thanks! Test page: |
Our issue is the original vTicker code does support this. It's not a difficult thing to add. If it's not something you want to support we will probably need to go back to using the original vTicker code. |
The other issue I found is if I use the
next
method, the ticker operates as expected. However, if I use theprev
method, the first item moves "down", but every subsequent item moves "up".After reviewing the code, I believe I found the issue. The
moveDown
function passes adir
value of'down'
intoanimate
the first time the code is run. However each time after the first, thenextUsePause
function is run.The problem is
nextUsePause
only callsmethod.next.call
, and nowhere ismethod.prev.call
called:There either needs to be the addition of a separate
prevUsePause
function, or a conditional innextUsePause
. I was able to make this work using the conditional approach. Here are the changes I made.1) Store "up" and "down" as state variables when in the "next" and "prev" methods:
2) Remove "dir" variables passed in to moveUp and moveDown:
3) Remove "dir" variable passed to animate, and add as a variable from state:
4) Add conditional logic to nextUsePause function:
I'd appreciate any feedback you might have. The previous option started working as expected once these updates were made.
The text was updated successfully, but these errors were encountered: