2 div boxes side by side with 50% width and 100% height, expanding to 100% fill up the whole width on hover on each box

Viewed 2721

I am trying to have 2 div boxes with 50% width each and 100% height.. and within that div box, it is like an anchor link where we hover the mouse over the 1st box (Box A), Box A will transition from its 50% width to full 100% width from left to right. And if we were to hover the mouse over on Box B, it would also transition from right to left and fill up the width 100%.

Maybe a picture can explain better.. This is the initial state: Initial State (without hover)

Then when the mouse hovers over Box A on the left: box a with hover

Then when the mouse hovers over Box B on the right: Box b with hover

I am unsure how to do this with CSS or with javascript/jquery or with both? I would appreciate if anyone could help me with this.

Thanks :)

7 Answers
Related