I have two elements and I want element1 to roll off and element2 will appear. Afterwhich when the button is clicked again, element2 rolls away to reveal element1 using CSS and/or Javascript.
Please use sample contents for these as I have no Html element sample to upload. Thanks
All you have to do is create a class with rolling animation style with the help of transform:translate(x, y) rotate(xdeg);
and toggle the class in both element1 and element2 with the help of Jquery on click event.
$('.button').click(function(){
$('.element1').toggleClass('roll-off');
$('.element2').toggleClass('roll-off');
});