+ 5
[jQuery] If slideToggle() animates to slide down/up. What's the animation code to slide sidewards?
What's the code for the side menu to slide sidewards?
4 Réponses
+ 6
That's not what I meant but nevermind, I'll get rid of it.
+ 4
Janning⭐ Already tried that, sorry I forgot to include that O already tried some animation sidewards. But that animation when it's closed, the texts inside messed up as it comes narrow slowly. Just like this code:
https://code.sololearn.com/Wm641zRJdSs9/?ref=app
+ 1
You can try:
https://stackoverflow.com/questions/17271169/slidetoggle-jquery-right-to-left
But keep in mind the caveats they list.
0
Hi Golden Rockstar,
Thanks for posting your code. I didn't realize that you wanted specifically to use animate instead of toggle, so I'm not really sure what you mean when you say "Already tried that," but it also looks like your end goal was probably a menu or navigation pane that slides out of the way like a tray. If that's still the case, I'm not sure why the solution in the article wouldn't work for you. I tested it in SoloLearn and it seems to work fine:
https://code.sololearn.com/W5A67UWUyJ6f/?ref=app
There are also ways of achieving this with just CSS, but your question was specifically for jQuery, so I didn't provide those references.