I create a small game in which the user selects from a set of elements, then the selected elements are shuffled and selected.
I use the jQuery loop ( http://jquery.malsup.com/cycle/ ) to run the main animation and select a random item (using the random order function and custom animation).
Nevertheless, the way of animating the elements means that I need them so that they are all visible during the animation - they are all absolutely positioned.
So here is the question: Is there a way to stop the jQuery loop from applying display: none; to all elements before its launch?
I do not mind changing the original script, if necessary.
$('#item-container').cycle({ fx: 'custom', cssBefore:{ left: 0, top: 0, display: 'block', zIndex: 1 }, animIn: { left: 200, top: 200 }, animOut: { left: 0, top: 0 }, cssAfter:{ zIndex: -40, display: 'block' }, speed: 400, timeout: 400, random: 1, autostop: 1, autostopCount: 25, continuous: 1, slideExpr: 'div.selected' });
Thanks!
source share