I have a list of items which can be displayed both vertically and horizontally:
http://jsbin.com/olefi3/2
Currently, toggling between these two modes makes for a rather jarring user experience, since items are repositioned rather suddenly (as CSS classes are being applied/removed). It would help greatly to have each item gradually move to its new position, making it easier for users to keep their orientation.
I know jQuery's animate method doesn't work for float. While I can imagine a solution, it seems rather complex:
Before I go about reinventing the wheel, does anything like this already exist?
Plugin you probably will like is isotope. Isotope will re-order content-blocks with CSS3 and fallback to jquery-animate. Check it out at: isotope
For starters, you need to include the jqueryui library right after you include the jquery library for the .toggleClass() call to animate at all
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js"></script>
This gets you closer to what you are looking for.
Good Luck
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With