-
Notifications
You must be signed in to change notification settings - Fork 97
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
Jump back to first? #17
Comments
Hi Koen: For example :
Then I would use the new .trigger() feature accordingly: // Go to previous floor // Go to next floor // Go to the 5th floor (JS calcul from 0) // Go up, down, left or right HOPE THIS HELPS or at least points you in the right direction. |
Thanks a lot ... but the question remains: My ascensorDirectionArray: Is it possible to go from [1,1] or [1,2] or [1,3] to jump to [2,0] rather than those directly below? I need some kind of 'switch floor'-function using the up and down arrows. Can you help me with such a feature? Maybe afterwards add to the script itself? Thanks for the feedback. Koen |
Hello Léo, Here is an example with instructions of how I want it to work: http://www.koenpopma.com/github/ascensor/. Greetings, Koen |
Léo, is is possible to enhance my solution and included in the library? I have added an option named 'directionStart', can be 'x', 'y' or say 'n' (for none, it would be ignored in the code and the default action of going up to the next 'level' occurs. The 'x' allows for jumping horizontally (Left/Right arrows). JUST FIND AND CHANGE THE handleChocolateDirection function to this:
ADD to the ascensor options in ascensor.js like this:
IN YOUR CODE include the directionStart option like so:
And that's it! ENJOY! As I said, I think this is a start and can be enhanced and added to the library as it is a very neat feature. |
Léo / Koen: Set and unset the 'queued' option accordingly to see the different sliding effects.
|
RE: Cool. Thanks. I'll let you know if i succeed. Love the approach, the startdirection is about the behavior of the up and down arrows. This has no effect on the left / right arrows to switch from floor (at the first or after the last item of the floor group). Do you have a solution for that too, Leo or Trinione? (Although "loop" has already been set to "true") I noticed it doesn't loop between [1,0] and [4,0]... is that possible? |
Ok, This is a more complicated issue. The way we did it for reverseBuro was by specifying direction for every single floor. The hack work that way.
I've put together a JSfiddle here: http://jsfiddle.net/kirkas/taCJn/ @koenpopma Also, even if that code seems logic and well done, it apply only for that specific case and include different navigation concept level. My goal is to come up with a solution working for all. I'm gonna separate this issue in two issue: Jump: Add an option to jump through floor to floor, on same axis, even if white space in between. PS: @trinione , Good code, i will definitely use some of that logic! fork and pull request next time :) |
@kirkas : I don't know what you mean by 'fork and pull request'. I am new to github and only figured out the markup a few days ago. If you have a link you can direct me to, I don't mind reading and learning. Thanks. |
The idea is that you fork this project, it mean that you create your own repository from mine. exemple: You can then modify the code as you wish (see end page of https://github.com/kirkas/Ascensor.js to understand my workflow). Once you considerate it done, create a pull request on github & i will review and ultimately merge those repository together. More here: https://help.github.com/articles/using-pull-requests |
Got yuh! |
Hey Léo/Trinione, Love the approach directionStart within the script (just changed chocolate-function), could you also hack the arrows if 'startDirection' is set (like: x, y of n) -> within the script? Like the example of Kirkas; to use left/right arrows as the prev/next arrows. if (self.options.directionStart) { |
Hi Léo,
I would like to create a similar website like Reverse Büro, where it is possible to navigate between the items (left / right) and sections (up / down) regardless which item is active, and if you switch between sections it jumps back to the first item.
I do not get it done with the new script. What is the solution?
Thanks in advance,
Koen.
The text was updated successfully, but these errors were encountered: