I have 4 boxes placed next to each other and I want to make so that when a user clicks on one of the boxes, a new box slides out next to it, pushing the other ones to the right.
So if the second box is clicked, a new boxes slides out to the right, pushing box 3 & 4 to the right.
This is how my boxes is setup:
http://jsfiddle.net/g8YXK/1/
I kind of don’t know where I should start with writing Javascript or jQuery code.
Should mention that I want it to “slide back” when same box is pressed again
I think this might be what you’re looking for: http://jsfiddle.net/r85WK/
It might require a tweak here or there, depending on how you want everything to work, but the bulk of what you’re asking for is built in there.