I have a little function that toggles my content from the left to the right with a sliding effect. Unfortunately the two div objects (with inline-block) due to their size don’t align next to each other when sliding, but one of them is obviously always beneath the other one.
See the jsfiddle code here
I tried the following:
- setting a
float:leftdidn’t help at all - positioning the
divs absolute, which helped but also created some unexpected behaviour when sliding from the right to the left (try it yourself) - delaying/queueing the animations, works but not really user-friendly with the delay
I also want to mention that floats and different positioning aren’t very helpful when you want your objects all centered, so I’d prefer another solution anyway.
Maybe you guys got an idea, how I could make this smooth, so that the divobjects stay in one line ?!
Did a lot of changes, sorry about that, but try this:
http://jsfiddle.net/jcZ6J/9/
Also note, that you should not place a
divinside anatag.HTML
JS
little update here so that resizing the window is not a problem
CSS