Looking to create a Lego instruction animation, but having trouble selecting variables as selectors for the needed animations. When clicking the 'next' and 'back' buttons, I want to animate through the options and count variables sequentially.
In addition, I need the 'reset' button to take me back to the first page of the animation. Any assistance or guidance on this would be greatly appreciated. Thank you.
Click here to see a rough image of how it looks.
$(document).ready(function() {
var options = ['legs', 'body1', 'cape1', 'cape2', 'head1', 'helmet1']
var count = 0;
$('.back').click(function() {
if (count > 0) {
count--;
$('selector-name-here').eq(count).animate({ top: '250px' });
}
})
$('.next').click(function() {
$('selector-name-here').eq(count).animate({ top: '250px' }, 'slow');
count++;
})
$('.reset').click(function() {
count = 0;
$('selector-name-here').html('');
})
});